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…