From 0489045aee895e5ee786ea0fccd7e45823186412 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 25 Sep 2015 15:21:32 +0800 Subject: [PATCH] added buildings data for frontentd --- app/controllers/spaces_controller.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/spaces_controller.rb b/app/controllers/spaces_controller.rb index 7ddf3a3..bd55ad9 100644 --- a/app/controllers/spaces_controller.rb +++ b/app/controllers/spaces_controller.rb @@ -1,8 +1,17 @@ class SpacesController < ApplicationController def index + buildings = Building.all.collect do |building| + { + "building-title" => building.title, + "building-image" => building.image.url, + "alt-title" => building.title + } + end + { + "buildings" => buildings, "extra" => { - + } } end