Displaying 1 result from an estimated 1 matches for "addr_f".
Did you mean:
addr_t
2009 Jun 24
1
accepts_nested_attributes_for :reject_if issue
...end
end
class ShippingAddress < OrderAddress
attr_accessor :has_shipping_address
end
class OrderAddress < ActiveRecord::Base
validates_presence_of :name
#more validations here..
end
And the view:
<% form_for @order do |f| %>
#...
<% f.fields_for :shipping_address do |addr_f| %>
<%= addr_f.check_box :has_shipping_address %>
<%= addr_f.text_field :name %>
#more fields for the address..
<% end %>
<% end %>
The problem is that :reject_if doesn''t seem to do it''s job. No matter
what the value for has_shipping_addre...