Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide 'any' select option from Select Input type filter #1533

Closed
kapsdewade opened this issue Jul 18, 2012 · 2 comments
Closed

hide 'any' select option from Select Input type filter #1533

kapsdewade opened this issue Jul 18, 2012 · 2 comments

Comments

@kapsdewade
Copy link

I want to hide or remove 'any' from select option based on user role... is there any way to do that?
this is what i tried

filter :product_type, :as=>:select, :include_blank =>false, :collection => ['a','b','c'] ...but no effect

in case...
following is the code for hiding 'any' from all select option in activeadmin

module ActiveAdmin
module Inputs
class FilterSelectInput < ::Formtastic::Inputs::SelectInput
def input_options
super.merge(:include_blank => false)
end
end
end
end

put this code in initializer/active_admin.rb

@jpmckinney
Copy link
Contributor

In your locale file, can't you just change the 'active_admin.any' key to false?

en:
  active_admin:
    ...
    any: false
    ...

If this answers your question, please close issue.

@kapsdewade
Copy link
Author

@jpmckinney :
i moved on with other solution....
someone added "if" to filter, so i used that one...anyways, i am closing this issue.
i tried above but didn't work out. Thanks for replying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants