Skip to content

Instantly share code, notes, and snippets.

@marinados
Created January 13, 2016 14:30
Show Gist options
  • Save marinados/b86dbc2ad97225fd94f9 to your computer and use it in GitHub Desktop.
Save marinados/b86dbc2ad97225fd94f9 to your computer and use it in GitHub Desktop.
# search(column name ('or' to be able to search in several columns + type de recherche, e.g. 'end' - last characters of the column, 'cont' - contains)
User.search('email_end' => 'gmail.com').result
User.search('first_name_or_last_name_cont' => 'bob').result
ActiveAdmin.describe User do
filter :first_name_cont, label: 'First Name'
end
# association name + name of column in the associated model + type of search
ActiveAdmin.describe User do
filter :preferences_content_cont, label: 'Preferences'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment