Hello Everyone, I am having problems in implementing joins in ror. as I used
[code]@users=User.joins('LEFT OUTER JOIN donations ON donations.user_id = users.id')[/code]
I also tried
[code]@users=User.find_by_sql "select u.*, d.amount from users u left join donations d on u.id=d.user_id"[/code]
but since model name is user it only displays all records of users table not a single record of donations table. I want to display records of both tables users and donations with the help of foreign key user_id in donations.
Thanks in advance