Maybe they have the same id :-), checkout your database and see if they have the same id
2010/7/21 Lily ^_^ <[email protected]> > Hi, > > I have a model "Theme" which has_and_belongs_to_many "Lessons". > > I need to get the (db) id of the lessons through the theme. > For instance, if in irb I write something like this : > > test = Theme.find(:first) > puts test.lessons.first.id > > I get the ID of test (the theme) and not of the lesson. > > Do you know how to get the id of the nested object instead ? > > Thanks > Lily > -- > 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]<rubyonrails-talk%[email protected]> > . > 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 [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.

