Last active
August 29, 2015 14:07
-
-
Save satomixx/bb455584ac0115e1b277 to your computer and use it in GitHub Desktop.
[Rails 4.x] ActiveAdmin をカスタマイズして、indexやshowでassociation関係のテーブルのカラムも表示させる ref: http://qiita.com/tsumekoara/items/84f87fb8bd85f625129e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Maker < ActiveRecord::Base | |
has_many :products | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveAdmin.register Product do | |
show do |f| | |
panel "Subject" do | |
attributes_table_for f, :id,:name,:description,:maker | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment