-
-
Save daansari/a07e7c63287f5880fe0c to your computer and use it in GitHub Desktop.
Getting jquery token to work with acts-as-taggable-on
This file contains hidden or 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 hidden or 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