Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add auto complete in ActiveAdmin
ActiveAdmin.register AdminUser do
# define routes for "autocomplete :admin_user, :email"
collection_action :autocomplete_admin_user_email, :method => :get
controller do
autocomplete :admin_user, :email
end
index do
column :email
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end
# make "filter :email" can autocomplete
filter :email_contains, :as => :autocomplete, :url => '/admin/admin_users/autocomplete_admin_user_email',
:label => "Search Email", :required => false, :wrapper_html => {:style => "list-style: none"}
form do |f|
f.inputs "Admin Details" do
f.input :email, :as => :autocomplete, :url => autocomplete_admin_user_email_admin_admin_users_path
f.input :password
f.input :password_confirmation
end
f.buttons
end
end
@gagansharma
Copy link

gagansharma commented May 3, 2013

I am getting this error

undefined method `email_contains' for #MetaSearch::Searches::Product:0xcf30280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment