sferik/rails_admin — Issue #886: has_many + nested forms = redundant fields
Author: rudf0rd
Created: 2011-12-19 10:12:11+00:00
State: open

Screenshot: http://cl.ly/021Z2O3i0Z3Y2K0E1w3w

Here's my definitions:

class Event < ActiveRecord::Base
[...]

has_many :event_days, :dependent => :destroy, :inverse_of => :event
accepts_nested_attributes_for :event_days, :allow_destroy => true
attr_accessible :event_days_attributes

[...]
end

###########

class EventDay < ActiveRecord::Base
attr_accessible :start_date, :end_date
belongs_to :event, :inverse_of => :event_days
end

###########

So, how can I remove these extra fields?

Sidenote: this project is getting better and better. I use it in most of the new projects I start. Thanks guys!