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

morristech/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 66.3%
  • HTML 15.9%
  • CSS 13.3%
  • JavaScript 4.5%