Tag Archives: has_one

Nested Has_one Relationship with Fields_for and Attr_accessible in Model Class

To make child attributes accessible to your model through a nested forms (Rails 2.3) you'll need to add the "#{child_class}_attributes" to the attr_accessible method in your parent class. If you don't use attr_accessible in your parent model (you would do this to restrict certain attributes to be accessed via a web form) then you should be all set.
Posted in Ruby on Rails | Also tagged , | 13 Comments

Nested Attributes in a Form for Has_One Model Association in Rails

Just for reference… class Member < ActiveRecord::Base has_one :member_profile accepts_nested_attributes_for :member_profile end
Posted in Ruby on Rails | Also tagged , | Leave a comment