Thanks Colin...  I looked into it in parallel ... not obvious but I
found the solution (many tries.. as it's not the 'standard' way.. but
I'm just writing a quick app draft)

<% form_for :tutor, @tutor, :url => { :action => "create" }  ....
for  new/create records

<% form_for :tutor, @tutor, :url => tutor_path(@tutor),  .. for  edit/
update

@tutor being a User instance...


On 10 oct, 18:18, Colin Law <[email protected]> wrote:
> 2009/10/10 Erwin <[email protected]>:
>
>
>
>
>
> > @trainee is an instance of User class
>
> > my form partial code :
>
> > <% form_for :@trainee, :html => {:class => 'generalform'} do |form| %>
> >        <%= render :partial => "form", :object => form %>
> >         <%= form.submit "Register", :class => 'go' %>&nbsp;<%= link_to
> > 'Cancel', trainees_path %>
> > <% end %>
>
> > the generated html is obviously :
> > <form id="new_user" class="generalform" method="post" action="/users">
>
> > but I would like to send it to a trainee_controller  (rather than to
> > user_controller... )
>
> > (don't want to subclass, I am using roles, and a trainee is a user
> > with 'trainee' role
>
> > is it possible ?if yes, how should I proceed ?
>
> Have a look at the docs for form_for, the :url option will let you do this.
>
> Colin
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to