Module: ActiveAdminTokeninput::DSL

Defined in:
lib/active_admin_tokeninput/dsl.rb

Instance Method Summary collapse

Instance Method Details

#tag_autocomplete(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/active_admin_tokeninput/dsl.rb', line 3

def tag_autocomplete(options={})


 		collection_action :autocomplete, :method => :get do
 			collection = scoped_collection.where("name ILIKE ?", "%#{params[:q]}%").order('lower(name) ASC').limit(10)
 		 	render :json => collection.as_json(:only => [:id, :name]), root: false
 		end
end