Skip to content

Instantly share code, notes, and snippets.

@mreigen
Forked from a-chernykh/active_admin.en.yml
Last active March 13, 2018 15:15
Show Gist options
  • Save mreigen/371eebf648bc6994a3000e0e31d9c54e to your computer and use it in GitHub Desktop.
Save mreigen/371eebf648bc6994a3000e0e31d9c54e to your computer and use it in GitHub Desktop.
Add "not equals" option to ActiveAdmin string filter
# in my experience, adding this will duplicate the filter list next to the input
en:
active_admin:
filters:
predicates:
not_eq: "Not equals"
# save this in lib/active_admin/inputs/
# to use this in the admin/dish.rb for example
# filter :name, as: :string_with_negative
module ActiveAdmin
module Inputs
module Filters
class StringWithNegativeInput < StringInput
filter :contains, :equals, :starts_with, :ends_with, :not_eq
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment