How can I join these tables?

I am also kind of stuck here, you can do 2 thigns to check what's going wrong. Check the logs for the sql query that's going to the db, and see if that's the one you want. 2. use the debug () function to print the class of the result. some thing like this in your view <%= debug(@unit) %>

I know these are not the answers, but it might some how lead to answers.

raj

hi, what i understood and as far as my knowledge of rails goes i tried this

Unit.find(unit.id).rooms.each do |x| x.rentals.each do |y| p Person.find(y.person_id) end end

gave results

regards gaurav