I have the following form :

<% form_for :registration, @registration, :url => { :action =>
"create" } , :html => {:class => 'generalform'} do |form| %>
<%= render :partial => "form", :object => form %>
 <%= form.submit "Register", :class => 'go' %>&nbsp;<%= link_to
'Cancel', registrations_path %>
<% end %>

with this partial :  (2  form select)
<div class="set" id="site_fields" style="margin-bottom:10px;">
        <div class="setbox">
                <%= form.label :trainee %><br />
                <%= form.select(:trainee_id, @trainees.map {|s| [s.name, s.id]},
{:include_blank => '- select a trainee -' }, :style => "width:
200px;", :onchange => remote_function( :method => "post",
:with => "'trainee_id=' + value", :url =>
choose_registrations_path )  )%>
        </div>
        <div id="select_epath" class="setbox" style="margin-left:10px;">
                <%= form.label :educational_path %><br />
                <%= form.select(:epath_id, @epaths.map {|g| [g.kp_path_name, 
g.id]},
{:include_blank => '- select an educational path  -' }, :style =>
"width:200px;"  ) %>
        </div>
        <div class="clear"></div>
</div>


whenever the first select change (trainee)  an Ajax request is fired
(remote_function) and the choose action in controller registrations is
executed ... working well  , based on the trainee _id , an array
@epaths should be displayed in the second form.select..

I I put the second select in a partial, I loose the form

should I write ALL the form in a select a refresh it, or can I refresh
only the 2 select ?

thanks for your help

erwin

--~--~---------~--~----~------------~-------~--~----~
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