Written by Sean Behan on Sun Jun 17th 2012

Just for reference...

class Member < ActiveRecord::Base
    has_one :member_profile
    accepts_nested_attributes_for :member_profile
end

<% form_for @member do |f| -%> <%= f.label :fullname %> <%= f.text_field :fullname %> <% f.fields_for :member_profile, @member.member_profile do |member_profile|%>

<%= member_profile.label :about %><%= member_profile.text_field :about %>

<%= member_profile.label :favorite_color %><%= member_profile.text_field :favorite_color %>

<% end %>


Tagged with..
#forms #has_one #nested #Ruby on Rails

Just finishing up brewing up some fresh ground comments...