It updates both parent and child models.  The Parent model is the order, you
can change the name of the order, add and remove children (line items), etc.
I kept the data model very simple so that the basics of the form didn't get
lost.  You can use the same setup for any Model with a has_many child
relationship.

-----Original Message-----
From: Claudio Poli [mailto:masterk...@gmail.com] 
Sent: Tuesday, December 01, 2009 10:20 AM
To: Ruby on Rails: Talk
Subject: [Rails] Re: accepts_nested_attributes_for and belongs_to

sorry, but I'm trying to update an attribute of a parent model..

On 1 Dic, 19:12, "Joe McGlynn" <j...@crimescenechoppers.com> wrote:
> I put together a sample app that shows how to do this.
>
> Details here:https://joemcglynn.wordpress.com/wp-admin/
> The project can be downloaded from
github:http://github.com/canonical/OrderItemsExample
>
>
>
> -----Original Message-----
> From: Claudio Poli [mailto:masterk...@gmail.com]
> Sent: Tuesday, December 01, 2009 10:08 AM
> To: Ruby on Rails: Talk
> Subject: [Rails] accepts_nested_attributes_for and belongs_to
>
> hi everyone,
> using Rails 2.3.5 I cannot update the attributes for a belonging
> object, pastie:http://pastie.org/722059
>
> ideas?
> thanks
>
> --
>
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group
athttp://groups.google.com/group/rubyonrails-talk?hl=en.

--

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-t...@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.



--

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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to