Auto_complete vs select_tag


i have 2 models and 1 join_table:


has_many :joins, :dependent => :destroy
has_many :people, :through => :joins


has_many :joins, :dependent => :destroy
has_many :films, :through => :joins


belongs_to: film
belongs_to: person

in views/films/ _form.rhtml

<%- f.fields_for :joins do |builder| %>
<%= render “films/join_fields”, :f => builder %>
<%- end %>

in the partial join_fields.rhtml :

<%= :person_id, options_for_select(Person.all(:order=> ‘name
asc’).map {|p| [,]}, f.object.person_id)%>

<%= f.hidden_field :_destroy %>
<%= link_to_function “delete”, “remove_fields(this)” %>

I would like to change ( because there is a lot of records ) by

any idea ?



use jquery autocomplete. don’t use joins
as an
association name because it’s an argument for the find method.

On Mon, Feb 14, 2011 at 12:38 AM, Patrice Cartier
[email protected]wrote:


asc’).map {|p| [,]}, f.object.person_id)%>
any idea ?
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at

Ok thanks for the info.
I’m gone a try…

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