我想在加载特定页面之前显示一些内容。我正在使用主动管理员。我怎样才能做到这一点?
ActiveAdmin.register User do
config.batch_actions = false
config.paginate = false
menu false
actions :index, :destroy, :show
index do
column 'ID', :id
column :name
column :short_name
column :start_date
column :end_date
column :aggregatable
column :branch do |user|
link_to user.branch.name, active_user_branch_path(id: user.branch_id)
end
column :lock_status
default_actions( name: 'Actions' )
end
end
回答有关如何在ActiveAdmin中设置过滤器之前的问题:应在控制器中设置过滤器之前。
图案:
controller do
before_filter :my_filter, only: %i(index)
private
def my_filter
#logic here
end
end
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句