Does select support arrays in a form with multiple models?


#1

i have a one-to-many model (an addressbook of contacts with many phone
numbers). i want to represent a select element so that its name is an
array containing the phone_number id…

Work Home Fax

other form elements (such as text_field) allow for this, but i haven’t
found a way of getting the select element to work with arrays.


#2

jose wrote:

other form elements (such as text_field) allow for this, but i haven’t
found a way of getting the select element to work with arrays.

The above should work. Written as a helper call:

select :phone_number, :location_or_kind, %w(Work Home Fax), {}, :index
=> 1


We develop, watch us RoR, in numbers too big to ignore.