Displaying 2 results from an estimated 2 matches for "all_blank".
Did you mean:
allow_blank
2009 Nov 06
0
Nested objects not propagating from view
..."
t.datetime "updated_at"
end
# relevant models
class User < ActiveRecord::Base
belongs_to :contact
has_many :properties
has_many :notes, :through => :properties
accepts_nested_attributes_for :contact, {
:allow_destroy => true,
:reject_if => :all_blank
}
end
class Contact < ActiveRecord::Base
has_one :user
belongs_to :address
belongs_to :biztype
accepts_nested_attributes_for :address, {
:allow_destroy => true,
:reject_if => :all_blank
}
end
class Address < ActiveRecord::Base
has_one :contact
h...
2009 Oct 06
1
Problems Processing multiple form elements generated by javascript actions
...ck_box :saturday %>
<%= schedule_form.check_box :sunday %>
<% end -%>
</div>
User Model:
validates_associated :schedules, :on => :update
after_update :save_schedules
accepts_nested_attributes_for :schedules, :allow_destroy => :true,
:reject_if => :all_blank
def new_schedule_attributes=(schedule_attributes)
schedule_attributes.each do |attributes|
schedules.build(attributes)
end
end
def existing_schedule_attributes=(schedule_attributes)
schedules.reject(&:new_record?).each do |schedule|
attributes = schedule_attribut...