move to evented mustache system

This commit is contained in:
2012-11-28 20:15:59 +01:00
parent 3da9dc68d7
commit 0fa0d1e0ba
31 changed files with 324 additions and 176 deletions
+11 -6
View File
@@ -7,6 +7,16 @@ class ApplicationController < ActionController::Base
private
def broadcast_user(uid, event, data = {})
message = {channel: "/user/#{uid}", data: {event: event, data: data}}
uri = URI.parse("http://localhost:9292/faye")
Net::HTTP.post_form(uri, :message => message.to_json)
end
def broadcast_supplier(sid, event, data = {})
message = {channel: "/supplier/#{sid}", data: {event: event, data: data}}
uri = URI.parse("http://localhost:9292/faye")
Net::HTTP.post_form(uri, :message => message.to_json)
end
def set_locale
I18n.locale = :nl
end
@@ -14,7 +24,7 @@ class ApplicationController < ActionController::Base
def layout_by_resource
if devise_controller?
case session[:user_return_to]
when /\/user\// then ''
when /\/user\// then 'obtain_token'
when /obtain_token/ then 'obtain_token'
else 'theme1'
end
@@ -50,9 +60,4 @@ class ApplicationController < ActionController::Base
{ok: true, message: message}.merge(options).to_json
end
def broadcast_user(uid, event, data = {})
message = {channel: channel, data: {event: event, data: data}}
uri = URI.parse("http://localhost:9292/faye")
Net::HTTP.post_form(uri, :message => message.to_json)
end
end