Getting data from all tables in a join query in Rails 3.
I wonder if someone can help me with this because I am going crazy. I tried for weeks now to join tree tables and access the data from ALL of the tables and not only one.

The three tables are called:

Page
Text
Image

I tried with this but it did not work:

    @texts = Page.joins([:texts, :images]).where(['pages.id = ?', @page])

The main one is Page which has_many texts and images. I want to do a query and get the data from all of them in one query. How is that possible in Rails 3? I cannot find a good example anywhere, not even in the official guides.

Please help!
Getting data from all tables in a join query in Rails 3.
===

I wonder if someone can help me with this because I am going crazy. I tried for weeks now to join tree tables and access the data from ALL of the tables and not only one.

The three tables are called:

Page
Text
Image

I tried with this but it did not work:

    @texts = Page.joins([:texts, :images]).where(['pages.id = ?', @page])

The main one is Page which has_many texts and images. I want to do a query and get the data from all of them in one query. How is that possible in Rails 3? I cannot find a good example anywhere, not even in the official guides.

Please help!