gregbell/active_admin — Issue #600: The nested object disappear
Author: regdog
Created: 2011-10-11 05:53:31+00:00
State: open

I am with activeadmin0.3.2. Adding accepts_nested_attributes_for to the model makes the nested object disappear.

# Customize form
form :html => { :enctype => "multipart/form-data" } do |f|
f.inputs do
f.input :name
f.input :description
end
f.inputs :multipart => true do
f.semantic_fields_for :image do |image|
image.input :upload, :as => :file
end
end
f.buttons
end

# Product Model
class Product< ActiveRecord::Base
has_one :image, :as => :attachable, :dependent => :destroy
accepts_nested_attributes_for :image, :allow_destroy => true
end