I have a user and a profile model. One user can have many profiles. I need to access only one information from the profiles section (viz the phone number) in my user model d
You can use 'accepts_nested_attributes_for' to do this; but there's a little trick in forms:
You must use the singular, and call fields_for for each profile, like this:
<% form_for @user do |f| -%>
<% @user.profiles.each do %>
<% f.fields_for :profile_attributes, profile do |ff| -%>
<% end %>
Notice that is :profile_attributes, instead of just :profile.