Frederick Cheung wrote:
� � � </p>
>
> That's not going to put parameters in the form expected by
> accepts_nested_attributes_for (the easiest way to do that is to use
> fields_for). You're also not submitting name or place attributes for
> crc so the crc wouldn't able to be saved anyway. Last of all you say
> you want tp create a new crc, but you're asking the user to choose
> from a drop down populated with existing crcs, which doesn't make
> sense to me
>
> Fred
Hi,
I understand the non-sense. I used fields_for and it's works but as you
say, I create a new crc when I want to edit one.
I put a partial on my users views:
<% f.fields_for :crcs do |crc| %>
</p>
<%= render :partial => 'crcatt', :locals => { :f => crc } %>
</p>
<% end %>
and on "_crcatt.html.erb" I got:
<%= f.collection_select( :user_id, @crcs, :id, :name) %>
how can I edit the choosen crc ? I'am a 'little' bit lost... I only got
4 month of rails experience and 1 years of OO language. Sorry for
telling you my life ;).
Thanks for your help.
Loïc
--
Posted via http://www.ruby-forum.com/.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.