# Form\_for won't generate the correct action path

**URL:** <https://www.ruby-forum.com/t/form-for-wont-generate-the-correct-action-path/190809>\
**Category:** Rails\
**Created:** [June 28, 2010, 3:47pm UTC](https://www.ruby-forum.com/t/form-for-wont-generate-the-correct-action-path/190809 "2010-06-28T15:47:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardsugg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@richardsugg](https://www.ruby-forum.com/u/richardsugg)\
**Post date:** [June 28, 2010, 3:47pm UTC](https://www.ruby-forum.com/t/form-for-wont-generate-the-correct-action-path/190809/1 "2010-06-28T15:47:34Z")

</div>

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

but instead it produces

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.

---

<div class="post-metadata">

**Author:** ![richardsugg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@richardsugg](https://www.ruby-forum.com/u/richardsugg)\
**Post date:** [June 28, 2010, 4:16pm UTC](https://www.ruby-forum.com/t/form-for-wont-generate-the-correct-action-path/190809/2 "2010-06-28T16:16:51Z")

</div>

Hi Richard,

On Mon, 2010-06-28 at 06:46 -0700, richardsugg wrote:

> 

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

---

<div class="post-metadata">

**Author:** ![richardsugg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@richardsugg](https://www.ruby-forum.com/u/richardsugg)\
**Post date:** [June 28, 2010, 8:18pm UTC](https://www.ruby-forum.com/t/form-for-wont-generate-the-correct-action-path/190809/3 "2010-06-28T20:18:09Z")

</div>

Thanks, Bill. I checked out the documentation on REST and it makes  
much better sense now.
