I''m really baffled since this should be very textbook: <% form_for :person, :url => { :controller => "people", :action => "update", :id => @person.id } do |form| %> should produce <form action="/people/3/update" ...> but instead it produces <form action="/people/3" ...> What''s going on? I really thought I could just do <% form_for :person, :url => { :action => "update", :id => @person.id } do |form| %> but that produces the same result. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Richard, On Mon, 2010-06-28 at 06:46 -0700, richardsugg wrote:> I''m really baffled since this should be very textbook: > > <% form_for :person, :url => { :controller => "people", :action => > "update", :id => @person.id } do |form| %> > > should produce > > <form action="/people/3/update" ...> > > but instead it produces > > <form action="/people/3" ...>With REST, /people/3 using the PUT verb maps to the update method. Run ''rake routes'' in the console to see the routes your app responds to / is generating. HTH, Bill -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks, Bill. I checked out the documentation on REST and it makes much better sense now. On Jun 28, 10:15 am, bill walton <bwalton...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Richard, > > On Mon, 2010-06-28 at 06:46 -0700, richardsugg wrote: > > I''m really baffled since this should be very textbook: > > > <% form_for :person, :url => { :controller => "people", :action => > > "update", :id => @person.id } do |form| %> > > > should produce > > > <form action="/people/3/update" ...> > > > but instead it produces > > > <form action="/people/3" ...> > > With REST, /people/3 using the PUT verb maps to the update method. Run > ''rake routes'' in the console to see the routes your app responds to / is > generating. > > HTH, > Bill-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.