developerinlondon wrote: > Hi, > > I am having difficulties accessing parent properties/attributes from > the child. Anyone could shed some lights onto this? > > Heres a sample code: [...]
Your sample code will not do the job. All you need is class Parent > ActiveRecord::Base has_many :children end class Child > ActiveRecord::Base belongs_to :parent end ...and parent.children and child.parent will work as you'd like. @connector is unnecessary. Check the docs for Associations; Rails makes this ridiculously simple. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk@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 -~----------~----~----~----~------~----~------~--~---