On May 15, 12:05 pm, “[email protected]” [email protected] wrote:
Thank you.
First, as an exercise in Javascript, I decided to program it:
<%= collection_select(“clim”, “themodel_id”, @themodels, “id”, “nom”,
{}, {:onchange => “updateLink($(‘edit_link’))”}) %>
<%= link_to(‘edit’, {:action => “edit”, :id => “temp”}, {:id =>
“edit_link”}) %>
But, if you still want to use it, it up to you 
About the form, that’s just a regular form as I’m sure you’ve made
before.
<%= form_tag({:action => “edit”}) %>
<%= collection_select(“clim”, “themodel_id”, @themodels, “id”, “nom”)
%>
<%= submit_tag(“edit”) %>
<%= end_form_tag %>
Then in the edit action, params[“clim”][“themodel_id”] is your id,
which you can then use in whatever way you like.
BTW, in both situations, it may be cleaner not to use “select”, but
“select_tag”, because you’re only using the id to redirect you to
somewhere else. “Select” takes in an object and method name, to be
used for automatic attribute and retrieval for creating or editing
values, but you don’t do that here.