Suppose I have an ActiveAdmin model with two scopes like so:
ActiveAdmin.register Book do
scope :all, default: true
scope :smith #all books by author 'smith'
index do
column :title
column :published_year
column :author
end
end
I don’t want/need the ‘author’ column when the user has selected the ‘smith’ scope.
So is there a way to get access to the current scope and only show the author column in one of the scopes? I suppose for this example I could use a custom view and check the actual content of the data but I am hoping there is an easier and better way.
you can try something like that