Skip to content

Adds a 'has_many_token' form field type to Active Admin to avoid huge select fields, using jQuery tokeninput

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
MIT-LICENSE
Notifications You must be signed in to change notification settings

MBSSearch/active_admin_tokeninput

 
 

Repository files navigation

active_admin_tokeninput

Credit goes to James Smith (http://loopj.com) for the jquery tokenInput plugin

Installation

gem 'active_admin_tokeninput'

Add this line to the active_admin model file, which sets up the autocomplete route.

ActiveAdmin.register Post do
	tag_autocomplete
end

Add this to your activeadmin form if it's a has_many reationship

f.input :posts, as: :has_many_token

Otherwise if it's a belongs_to

f.input :author, as: :belongs_to_token

If you need to define your own autocomplete path

f.input :posts, as: :belongs_to_token, autocomplete_path: autocomplete_admin_author_posts_path

About

Adds a 'has_many_token' form field type to Active Admin to avoid huge select fields, using jQuery tokeninput

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
MIT-LICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 63.6%
  • HTML 17.2%
  • SCSS 12.2%
  • JavaScript 4.8%
  • CSS 2.2%