I have a form for a model, that has an auto-fill button based on
existing record. Basically you can choose if to duplicate an existing
record using a select list of the record already in the db.
This select list is inside the form for the new model, but I need to
somehow submit it in an independent manner from the rest of the form. I
was able to do this with observe_field, but I want to do it using a
button or link:
<% form_for @product, :url => { :action => ''create'' }
do -%>
<%= collection_select :product, :id, Product.find(:all), :id, :name %>
<%= link_to ''fill form'', :url => { :action =>
''fill_form'' } %>
# product fields
<% end %>
I''m having trouble catching the actual selection in the params[], and
I''d really appreciate help on this - thanks.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---