有关如何使用ActiveAdmin DSL有条件地显示列的任何想法吗?
index do
selectable_column
id_column
column :name
column :address, if: current_user.admin?
column :phone
column :role
column :created_at
column :updated_at
actions
end
答案 0 :(得分:8)
您可以这样做:
index do
selectable_column
id_column
column :name
if current_user.admin?
column :address
end
column :phone
column :role
column :created_at
column :updated_at
actions
end