No "easy Rails compatibility" (AutoSuggest Version 1.4)

Mark Azevedo's Avatar

Mark Azevedo

01 Apr, 2010 07:35 PM

Setting the asHtmlID still prepends "as_values" to all Autosuggest field parameters sent.
(example) asHtmlID:'person_hobby' will generate the following parameter: "as_values_person_hobby".

I've been using it successfully in Rails by parsing and removing the "as_values" prefix, where it can then be processed automatically. It would be much simpler for new users if they didn't have to do this.

Thanks for the otherwise great plugin, but I'm going to postpone upgrading until this and the item removal bug is fixed :)

  1. 1 Posted by Garrett Lancast... on 28 Jan, 2011 08:41 PM

    Garrett Lancaster's Avatar

    The plugin page claims this is resolved but it's not...still no resolution?

  2. 2 Posted by Mark Azevedo on 28 Jan, 2011 09:10 PM

    Mark Azevedo's Avatar

    Since I last tested, version 1.4 still prepends "as_values" to the input name attribute's value. They simply removed the "as-input" from the input id. The name attribute defined what parameters are sent when the form is submitted, and will fail to save using Rails (without a little hackery).

    For example: If you have a Blog model with an author attribute... Rails will attempt to save Blog.as_values_author = "form value" from AutoSuggest's form parameters, unless you strip out the "as_values" in the controller.

  3. 3 Posted by Grant on 29 Jan, 2011 07:35 PM

    Grant's Avatar

    Unfortunately this also causes issues with CakePHP. Otherwise it's an impressive plugin. It's a shame development/bug fixing appears to have ceased.

  4. 4 Posted by Jérémy on 06 Aug, 2013 11:58 AM

    Jérémy's Avatar

    There's now a new maintained fork of the plugin that has a useOriginalInputName option to help in this exact situation : https://github.com/hlsolutions/jquery-autosuggest

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac