From 21e6686b7e8970b4b7c2392b8f4fea8d6072f25b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 1 Oct 2013 18:58:21 +0200 Subject: [PATCH] Fixed assets load. --- app/assets/javascripts/app/controllers/session.js.coffee | 4 +++- app/controllers/sessions_controller.rb | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/session.js.coffee b/app/assets/javascripts/app/controllers/session.js.coffee index 875ffd1ce..30c097aa7 100644 --- a/app/assets/javascripts/app/controllers/session.js.coffee +++ b/app/assets/javascripts/app/controllers/session.js.coffee @@ -26,7 +26,9 @@ class Index extends App.ControllerContent ) render: (data) -> - App.Collection.load( type: 'User', data: data.users ) + + # load collections + App.Event.trigger 'loadAssets', data.assets # fill users for session in data.sessions diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index c51806be5..977c73fb3 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -175,8 +175,10 @@ class SessionsController < ApplicationController end } render :json => { - :sessions => sessions_clean, - User.to_app_model => users, + :sessions => sessions_clean, + :assets => { + User.to_app_model => users, + }, } end