VocabReminder
English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
VocabQuiz
The app that quizzes and scores you on your vocabulary!
Click here for more info about the app

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


<% 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 w/ #forms #has_one #nestedruby on rails