Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Created November 18, 2015 07:02
Show Gist options
  • Select an option

  • Save YumaInaura/bcc66643a38586a10780 to your computer and use it in GitHub Desktop.

Select an option

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
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
class Image < ActiveRecord::Base
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment