Created
November 18, 2015 07:02
-
-
Save YumaInaura/bcc66643a38586a10780 to your computer and use it in GitHub Desktop.
Rails: ActiveAdmin で has_many なフォーム ( nested resouces ) を作るための最小構成 ref: http://qiita.com/Yinaura/items/e4cad1b59afe08b7de11
This file contains hidden or 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 Book do | |
| permit_params :title, images_attributes: [:kind] | |
| form do |f| | |
| f.inputs do | |
| f.input :title | |
| end | |
| f.inputs do | |
| f.has_many :images do |t| | |
| t.input :kind | |
| end | |
| end | |
| f.actions | |
| end | |
| end |
This file contains hidden or 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 Image < ActiveRecord::Base | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment