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 - 5 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 - 5 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 - 5 hrs

Glad to be of service!

Posted by Sammy Larbi on Aug 04, 2011 at 10:45 AM UTC - 5 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 (18)
AI/Machine Learning (13)
Answers To 100 Interview Questions (10)
Bioinformatics (1)
C and C++ (6)
cfrails (22)
ColdFusion (78)
Customer Relations (15)
Databases (3)
DRY (18)
DSLs (11)
Future Tech (5)
Games (4)
Groovy/Grails (8)
Hardware (1)
IDEs (9)
Java (38)
JavaScript (3)
Linux (2)
Lisp (1)
Mac OS (3)
Management (14)
MediaServerX (1)
Miscellany (69)
OOAD (37)
Productivity (9)
Programming (151)
Programming Quotables (6)
Rails (29)
Ruby (62)
Save Your Job (41)
scriptaGulous (4)
Software Development Process (22)
TDD (40)
TDDing xorblog (6)
Tools (5)
Web Development (7)
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