On Jul 21, 4:14 pm, Lily ^_^ <[email protected]> wrote:
> 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 ?
>

if your join table has an id column weird stuff like this will happen

Fred

-- 
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.

Reply via email to