# Form\_for - resource-oriented style question

**URL:** <https://www.ruby-forum.com/t/form-for-resource-oriented-style-question/169950>\
**Category:** Rails\
**Created:** [June 10, 2009, 4:51pm UTC](https://www.ruby-forum.com/t/form-for-resource-oriented-style-question/169950 "2009-06-10T16:51:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [June 10, 2009, 4:51pm UTC](https://www.ruby-forum.com/t/form-for-resource-oriented-style-question/169950/1 "2009-06-10T16:51:51Z")

</div>

in my routes I have a route  
new\_program\_registration GET /programs/:program\_id/  
registrations/new(.:format)  
{:action=\>“new”, :controller=\>“registrations”}  
to register a user in a training program

I preset the objects in the registrations\_controller : @program ,  
and @user=User.new

and have another route  
POST /programs/:program\_id/registrations(.:format)  
{:action=\>“create”, :controller=\>“registrations”}  
to receive the submitted form

I want to set up a form to get all data for this new user,  
but I know how to write the form\_for helper in order to post the form  
to the create action of the registration controller  
I wrote :

\<% form\_for @user, :url =\> program\_registrations\_path(@program[:id])  
do |form| %\>  
\<%… the all user textfields… …

but it seems to be wrong…
