I have a开发者_运维知识库 custom edit.html.erb form and I would like to it to call controller's update
This is the code I'm using for form
<%= form_tag('/schedules/1', :class => "edit_schedule") do %>
I'm getting "No route matches "/schedules/1" error.
Try this:
In controller edit action
def edit
@schedule = Schedule.find(1)
end
In view edit.html.erb
<%= form_tag(@schedule, :class => "edit_schedule", :method => :put) do %>
In routes.rb
resources :schedules
精彩评论