Select in form_remote_for

I am trying to use a slect box in my form, but I am stuck with an error
I cannot understand…

here is what I wrote according to the documentation …

<%= f.select (“property”, “user_id”, User.find_all.collect {|u| [
u.name u.id ] }, { :include_blank => true }) %>

user_id is a FK to a user (owner of the property)
Associations : User has_many properties, Property belongs_to User

when a property is selected, @property.user_id => 9
should display a selection list of all Users, with this one
selected… but

I get an error trying to display the form :

Showing app/views/property/_innerform.rhtml where line #15 (see above)
raised:
undefined method `merge’ for Array:0x25024d0
seems to indicates something is wrong with the collection… ? it’s
quite a copy/paste from doc…

kad

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs