Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get multiple to work nicely with Simple_Form? #208

Open
marcamillion opened this issue Feb 14, 2013 · 2 comments
Open

How do I get multiple to work nicely with Simple_Form? #208

marcamillion opened this issue Feb 14, 2013 · 2 comments

Comments

@marcamillion
Copy link

So I am trying to implement multiple autocomplete and simple_form and am getting an error.

I tried this:

<%= f.input_field :neighborhood_id, collection: Neighborhood.order(:name), :url => autocomplete_neighborhood_name_searches_path, :as => :autocomplete, 'data-delimiter' => ',', :multiple => true, :class => "span8" %>

This is the error I get:

undefined method `to_i' for ["Alley Park, Madison"]:Array

In my params, it is sending this in neighborhood_id:

"search"=>{"neighborhood_id"=>["Alley Park, Madison"],

So it isn't even using the IDs for those values.

Ideas?

@marcamillion
Copy link
Author

bump Any takers?

@manusajith
Copy link
Member

@marcamillion if you need the object_id you should use the id_element. Details here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants