I have a problem with select fonction and joins.
here is my current query.
@search = Building.joins(\'INNER JOIN \"floors\" ON \"floors\".\"building_id\"
You can do it like this... Hope its useful
@search = Building.select("buildings.name, floors.number, spaces.number").joins("INNER JOIN floors ON floors.building_id = buildings.id INNER JOIN spaces ON spaces.floor_id = floors.id")