My Secret Life as a Spaghetti Coder
home | about | contact | privacy statement
You can split an input on a specific string to get the same field to autocomplete multiple times. One example where you might want to do this is in the case of tags: You have a field that should contain multiple tags, and you want to do an autocomplete after every comma + space (', ').

It's not documented in the rails3-jquery-autocomplete README, but all you need to do is use the 'data-delimiter' attribute like this:

<%= f.label :category_tags %>
<%= f.autocomplete_field :category_tags, autocomplete_category_tag_title_library_assets_path, 'data-delimiter'=>', ' %>

Hopefully this helps you save a little time by allowing you to skip reading the implementation to find this detail.

Hey! Why don't you make your life easier and subscribe to the full post or short blurb RSS feed? I'm so confident you'll love my smelly pasta plate wisdom that I'm offering a no-strings-attached, lifetime money back guarantee!


Comments
Leave a comment

Great find Sam, right on time for something I am beginning to implement just now.

Posted by skumar on Jun 07, 2011 at 05:22 PM UTC - 6 hrs

Fantastic info Sam. I was literally struggling to get this functionality and I found your comment. Thanks a lot.

Posted by Nagarajan on Jul 18, 2011 at 11:21 PM UTC - 6 hrs

Hey Dude,

Thanks a lot, after two hours thinking & googling, i got your blog link & it was very helpful & my issue got resolved :)

Thanks

Posted by Vijay Kumbhar on Aug 04, 2011 at 09:52 AM UTC - 6 hrs

Glad to be of service!

Posted by Sammy Larbi on Aug 04, 2011 at 10:45 AM UTC - 6 hrs

Can you please tell me how to work with data-delimiter option with text_field tag with rails3 jquery autocomplete plugin?

Thanks in advance..

Posted by anusha on Aug 30, 2013 at 07:31 AM UTC - 6 hrs

Anusha,

The example in the post illustrates how to do it. Can you explain a little more about what's going on?

I haven't used this plugin lately, but I'm willing to try to help if I can!

Sam

Posted by Sammy Larbi on Aug 30, 2013 at 12:45 PM UTC - 6 hrs

Leave a comment

Leave this field empty
Your Name
Email (not displayed, more info?)
Website

Comment:

Subcribe to this comment thread
Remember my details
Google
Web CodeOdor.com

Me
Picture of me

Topics
.NET (19)
AI/Machine Learning (14)
Answers To 100 Interview Questions (10)
Bioinformatics (2)
Business (1)
C and Cplusplus (6)
cfrails (22)
ColdFusion (78)
Customer Relations (15)
Databases (3)
DRY (18)
DSLs (11)
Future Tech (5)
Games (5)
Groovy/Grails (8)
Hardware (1)
IDEs (9)
Java (38)
JavaScript (4)
Linux (2)
Lisp (1)
Mac OS (4)
Management (15)
MediaServerX (1)
Miscellany (76)
OOAD (37)
Productivity (11)
Programming (168)
Programming Quotables (9)
Rails (31)
Ruby (67)
Save Your Job (58)
scriptaGulous (4)
Software Development Process (23)
TDD (41)
TDDing xorblog (6)
Tools (5)
Web Development (8)
Windows (1)
With (1)
YAGNI (10)

Resources
Agile Manifesto & Principles
Principles Of OOD
ColdFusion
CFUnit
Ruby
Ruby on Rails
JUnit



RSS 2.0: Full Post | Short Blurb
Subscribe by email:

Delivered by FeedBurner