crowdint / rails3-jquery-autocomplete

An easy and unobtrusive way to use jQuery's autocomplete with Rails 3
http://rubygems.org/gems/rails3-jquery-autocomplete
MIT License
917 stars 367 forks source link

Rails 4 strong parameters #270

Closed ethicalhack3r closed 10 years ago

ethicalhack3r commented 10 years ago

I'm using rails3-jquery-autocomplete 1.0.14 with Rails 4.0.4 using strong parameters.

Here is an example of using the autocomplete in my view:

<%= f.label :wordpresses %> <%= f.autocomplete_field :wordpresses, autocomplete_wordpress_version_submits_path, 'data-delimiter' => ',', multiple: true %>

When submitting the form I get this error in my log:

Unpermitted parameters: wordpresses

Even though In have :wordpresses permitted in submit_params in my my controller.

This only occurs when I use 'data-delimiter' => ',', multiple: true, I suspect because we're now submitting an Array instead of a String which Rails 4 can't deal with by default?

Any suggestions on what changes I can make to make this work welcome. :)

bigtunacan commented 10 years ago

I'm just starting to convert my first project over to Rails 4 that is using this gem. So far I have not run into this issue. Did you find a work around?

ethicalhack3r commented 10 years ago

Unfortunately, I couldn't get it working for me on Rails 4. I decided to use http://loopj.com/jquery-tokeninput/ which met my needs.

bigtunacan commented 10 years ago

Ok; glad to hear you found something that worked for you.