In my Productclass there is a field pricethat has a corresponding column in the table Productsin the database and new_shopan auxiliary field (which is defined as attr_accessorit does not have the corresponding column in the table Productsin the database).
When the check for pricefails, the input field completes with the field_with_errorsdiv, but when the check for new_shopfails, it does not complete with the field_with_errorsdiv. Why?
Here is the generated HTML for these input fields:
<input type="text" name="product[price]" id="product_price">
<input type="text" value="" name="product[new_shop]" id="product_new_shop">
Additional Information:
class Product < ActiveRecord::Base
attr_accessor :new_shop
accepts_nested_attributes_for :shop
validates_presence_of :price
...
end
class Shop < ActiveRecord::Base
validates_presence_of :name
...
end
When the form is submitted, the value new_shopis passed to the product shop_attributes[:name].