Created
May 26, 2011 16:12
-
-
Save angelacode/993443 to your computer and use it in GitHub Desktop.
Getting jquery token to work with acts-as-taggable-on
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- semantic_form_for @question do |f| | |
= f.input :title, :label => "Type Your Question", | |
:wrapper_html => {:style => "list-style-type:none"}, | |
:input_html => {:class => 'main_question'} | |
= f.input :body, :input_html => {:class => 'autogrow', :rows => 5}, | |
:wrapper_html => {:style => "list-style-type:none"}, | |
:label => "Question Details (optional)" | |
= f.input :tag_list, :class => 'larger widest', :"data-pre" => @question.tags.map(&:attributes).to_json, | |
:wrapper_html => {:style => "list-style-type:none"} | |
= f.buttons do | |
= f.commit_button :label => "Ask Question", | |
:button_html => {:class => "main_question"} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* this is for the jquery token input */ | |
$(function() { | |
$("#question_tag_list").tokenInput("/questions/get_tags.json"), { | |
crossDomain: false, | |
prePopulate: $("#question_tag_list").data("pre"), | |
preventDuplicates: true, | |
theme: 'facebook' | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assuming you're using my copy of jquery tokeninput, new tags should work by pressing "comma" after them...