Skip to content

Instantly share code, notes, and snippets.

@abhijitsinha
Created July 19, 2013 09:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhijitsinha/8b6871cfda555d305be8 to your computer and use it in GitHub Desktop.
Save abhijitsinha/8b6871cfda555d305be8 to your computer and use it in GitHub Desktop.
Adding Tokeninput to ActiveAdmin
//= require active_admin/base
//= require jquery.tokeninput
$(document).ready(function(){
$('#token-input-mo').tokenInput('/method.json', {
crossDomain: false,
tokenLimit: 1,
minChars: 3,
hintText: "Type to search a field",
prePopulate: $('#token-input-mo').data('pre')
});
});
form do |f|
f.inputs 'School' do
f.input :school_id, :input_html => { :id => "token-input-mo"}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment