my routes for a specific controller of my application are (i create them manually):
scope :path => '/labor', :controller => :labor do
get '/' => :index, :as => 'labor'
post 'start/:work_hours' => :start, :as => 'start'
post 'stop' => :stop, :as => 'stop'
end
I’m creating a form_tag, but i’m having problems passing the posted value. My form currently is :
<%= form_tag start_path do %>
<%= select_tag :work_hours, options_for_select([ "1", "2", "3", "4", "5", "6", "7", "8" ], "1") %>
<%= submit_tag "#{t 'labor.start_work'}" %>
<% end %>
I would expect that to work, but unluckily, it does not and i don’t understand why. I actually get a routing error No route matches {:controller=>”labor”, :action=>”start”}
Why is this happening and how can i fix it, so that the :work_hours is properly posted from the form ?
you can actually try
then update your data n controller iwith
params[:start_labor][:work_hours]. That worked fine for me