在ActiveAdmin中自定义显示页面

ActiveAdmin中的默认显示页面是每行一个属性的表。 对于我的后端,这没关系,除了我想要隐藏id,created_at,updated_at等字段。

是否可以以类似于索引页面的方式执行此操作,即通过显式列出所需的属性,同时让AtiveAdmin处理布局?

文档中显示的唯一示例表明,要自定义显示页面,您必须完全接管并编写部分或arbre构造。

谢谢!

我想你正在寻找attributes_table:

show do attributes_table :name, :content end 

如果您感到好奇,请参阅https://github.com/gregbell/active_admin/blob/master/lib/active_admin/views/pages/show.rb 。

(我完全删除了我之前的答案,因为它基本没用!)

表明做

 attributes_table do row :profilepic do image_tag admin_user.profilepic.url, class: 'my_image_size' end row :name row :email row :adrs row :phone row :role row :salary row :parent_id row :joindate end 

结束