Skip to content

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

Open
@marcamillion

Description

@marcamillion

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?

Activity

marcamillion

marcamillion commented on Feb 19, 2013

@marcamillion
Author

bump Any takers?

manusajith

manusajith commented on Nov 22, 2013

@manusajith
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      How do I get multiple to work nicely with Simple_Form? · Issue #208 · crowdint/rails3-jquery-autocomplete