Hi all, I have a relatively simple scenario. I have a form that can have a list of multiple phone objects in it. I'm trying to get the edit and entry screens to work with unique field names. I have entry and record creation working, but I'm still working on edit. Is it possible for me to specify the value of the selected index to the "collection_select" method via an option or html option? I read the doc, but I can't find what I'm looking for. Below is my code, as you can see my field and select names are "phone_#" where # is the iteration index, but the actual variable is "phone".
Main form snippet
[code] <h2>Phones</h2> <table> <% n = 0 for phone in @phones do fieldname = "phone_#{n}"; %> <tr><td>Number:</td><td> <%= text_field_tag fieldname, phone.number%></
<td><%= get_phone_types fieldname%></td></tr>
<% n += 1 end %> <table> [/code]
helper with get_phone_types
[code]