Erwin,
If I understand what you are trying to do then I was trying to solve a
similar but lesser problem. How to send form data from one method in a
controller to another method in the same controller Iit does seem to
work for your case though). Here is a sample erb:
gather.html.erb
Gathering transient data
<% form_tag('transient/show') do %>
First Name
<%= text_field_tag "firstname", TransientData.firstname %>
Last Name
<%= text_field_tag "lastname", TransientData.lastname %>
<%= submit_tag "Submit" %>
<%end%>
show.html.erb
Gathering transient data
<% form_tag('/transient/gather') do%>
First Name
<%= TransientData.firstname %>
Last Name
<%= TransientData.lastname %>
<%= submit_tag "Submit" %>
<%end%>
If I change either erb file’s line:
<% form_tag(’/someothermodel/somemethod’)
It did swap form data between controllers.
I hope I understood your question. I am new to ruby.
Cris
Kad K. wrote:
@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’ %> <%= link_to
‘Cancel’, trainees_path %>
<% end %>
the generated html is obviously :
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 ?
many thanks ba
erwin