I have a problem with select fonction and joins.
here is my current query.
@search = Building.joins(\'INNER JOIN \"floors\" ON \"floors\".\"building_id\"
Look at your code:
Building.select('buildings.name, floors.number, spaces.number)...
You don't select the building id, so Rails is a bit lost when comes the time to retrieve it.
id