Been trying to figure out why my form won't work properly. -- this is the closest I get to getting it working, it shows the location field when I do this however when I submit form it says "Unknown attribute locations", which I believe is because locations should actually be accessed like f.inputs :name => "Location", :for => :location do | location_form|, instead of what I have below (right?) but when I do it non plural nothing shows up at all. If i do it plural, it doesen't know what to do with the location attributes. Can anyone tell me if I am doing something wrong, or if this is a bug? Thanks a ton in advance.
class Store < ActiveRecord::Base
has_one :location
belongs_to :admin_user
accepts_nested_attributes_for :location
end
class Location < ActiveRecord::Base
belongs_to :store
end
ActiveAdmin.register Store do
form do |f|
f.inputs "Details" do
f.input :name
f.input :description
f.input :admin_user
end
f.inputs :name => "Location", :for => :locations do |location_form|
location_form.input :address
end
f.buttons
end
end