I would like to be able to use the token fields (found here: http://railscasts.com/episodes/258-token-fields) with formtastic to allow users to input tags (I am using acts_as_taggable_on).
Can someone walk me through an example of how to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t have the time for a full walk-through, but the guts of this seems to be that a
text_fieldhas adata-preattribute with some JSON in it. The way to add attributes to inputs in Formtastic is via the :input_html option, so this:Might be translated to something like:
The rest is gluing CSS to HTML and finding the right DOM element to apply the jQuery to (view source is your friend).