ActiveAdmin nested form on #show page

后端 未结 2 362
温柔的废话
温柔的废话 2021-02-04 18:52

Is it possible to add nested form to #show page?

Now i have my admin/posts.rb:

ActiveAdmin.register Post do
  show         


        
2条回答
  •  一整个雨季
    2021-02-04 19:30

    I did something like this for a has_one relation :

    ActiveAdmin.register Post do
      show :title => :email do |post|
    
        attributes_table do
          rows :id, :first_name, :last_name
        end
    
        panel 'Comments' do
          attributes_table_for post.comment do
            rows :text, :author, :date
          end
        end
    
      end
    end
    

    If you didn't need the added flexibility of sorens' solution I bet you could work with that.

提交回复
热议问题