Thursday, October 14, 2010

[Rails] Help with nested form: User and Artist

Artist is 1:1 with User. User has_one :artist

In my artist model, I have:

belongs_to :user
accepts_nested_attributes_for :user

However, in my artist _form, the name column from the user model does
not display. I am doing:

<% f.fields_for :user do |builder| %>
<p class="fields">
<%= builder.label :name %>
<%= builder.text_field :name %>
</p>
<% end %>

How come?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate