简体   繁体   中英

rails_admin table of has_many in the show?

I would like to show a related has_many set of objects in the show view of the parent object as a table.

Currently the has_many items are just being shown as a list separated by commas.

How can I show the has_many items as a table and specify the columns to include?

For example Article has_many Autors .

Then you should just add in Article class:

accepts_nested_attributes_for :autors, allow_destroy: true
attr_accessible :autors_attributes

More info https://github.com/sferik/rails_admin/wiki/Has-and-belongs-to-many-association

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM