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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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:masterkain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
sorry, but I''m trying to update an attribute of a parent model.. On 1 Dic, 19:12, "Joe McGlynn" <j...-WSbigQczdccj0o55a+Ij8ljMPmZJtkid@public.gmane.org> 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...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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:masterkain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] 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...-WSbigQczdccj0o55a+Ij8ljMPmZJtkid@public.gmane.org> 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 fromgithub:http://github.com/canonical/OrderItemsExample> > > > -----Original Message----- > From: Claudio Poli [mailto:masterk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] > 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this groupathttp://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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.