Just new to Rails, and i have some questions :
How can i use ActiveRecord associations to retrieve all columns and rows including the columns and rows in the referenced table.?
SELECT parents.id, parents.parent_name, kids.id, kids.parent_id, kids.kid_name
FROM parents left join kids on parents.id = kids.parent_id
In PHP in can retrieve all rows returned by this query from all joined tables using mysql_fetch_array() and the output is
parents.id, parents.parent_name, kids.id, kids.parent_id, kids.kid_name
Is there an equivalent of this in RoR?
Here is the AR Associations that i want to retrieve all columns including those belonging to the referenced table
__* = primary key
- = foreign key__
Table : parents
Table : kids
class Parent < ActiveRecord::Base
class Kid < ActiveRecord::Base