Created
March 17, 2014 12:26
-
-
Save a-chernykh/9598346 to your computer and use it in GitHub Desktop.
Add "not equals" option to ActiveAdmin string filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
en: | |
active_admin: | |
filters: | |
predicates: | |
not_eq: "Not equals" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdmin | |
module Inputs | |
class FilterStringWithNegativeInput < FilterStringInput | |
filter :contains, :equals, :starts_with, :ends_with, :not_eq | |
end | |
end | |
end |
Just for everyone looking second file is not required! Just add the translation to your en.yml and then in each field you need this add something like this:
filter :first_name, filters: [:equals, :contains, :not_eq]
Thanks for this! Very helpful.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @andreychernih do you still use this? Where do I need to put the .rb file?