SQLTerminal.app
now available

XPath.app
now available
Want fresh tech tips in your inbox?

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

Apps I've Built

XPath Expression Editor
Practice and improve your XPath skills with XPath Editor
Click to buy on the App Store
Photo Location Changer
Easily change the location on your photos and videos
Click here for more info about the app
Photo Date Changer
Easily change the dates and times on your photos and videos
Click here for more info about the app
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