Closed kangguru closed 9 years ago
It's visible?
E.g.
register_instance_option :visible? do
current_model = ::RailsAdmin::Config.model(bindings[:abstract_model])
authorized? && current_model.drafts && bindings[:object].draft?
end
Another example here.
Docs that might help are on the rails_admin wiki here.
@kangguru, @rikkipitt, so, to remove the custom action button from the list views, it's okay to do something like this, right?:
register_instance_option :visible? do
# do not show the button on list
authorized? && bindings[:controller].request.params[:action] != 'index'
end
I'm trying to hide a custom action from models collection/index view. I've already tried plenty variation of
or
with
?
at the end, without (as the internet is not really specific about it)Then i found out about member actions
This won't have an effect, besides making the action to loose its icon and falling back to
?
Do i have to use the
visibility
-option? How to access the current action then? It looks like it just gives me thecontroller
What am i doing wrong? Help is really appreciated!