Customizing the show page in ActiveAdmin

后端 未结 3 1397
不思量自难忘°
不思量自难忘° 2021-02-14 02:35

The default show page in ActiveAdmin is a table with one attribute per row. For my backend, this would be fine, except that I want to hide fields such as id, created_at, updated

3条回答
  •  星月不相逢
    2021-02-14 03:05

    This will show an example of an object Package with a has_many relationship (FAQS)

      show do |package|
        attributes_table do
          row :slug
          ...
          row :hotel
          panel "FAQS" do
            table_for package.faqs do
              column :question
              column :answer
            end
          end
        end
      end
    

    It will be rendered like this:

提交回复
热议问题