application.rb
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Filters added to this controller will be run for all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
before_filter :detect_stuff_by_domain
before_filter :detect_edit_layout
def detect_edit_layout
@edit_layout = true unless params[:edit_layout].nil?
end
# after_filter :render_actions
def render_actions
@bla = 'funfou'
#return @bla
render_action('index', nil, true)
# render :update do |page|
# page.replace_html 'box_1', :partial => 'pending_todos'
# page.replace_html 'completed_todos', :partial => 'completed_todos'
# page.replace_html 'working_todos', :partial => 'working_todos'
# end
end
# def render(type = nil)
# render_actions
# end
protected
def detect_stuff_by_domain
@domain = Domain.find_by_name(request.host)
if @domain.nil?
@virtual_community = VirtualCommunity.default
else
@virtual_community = @domain.virtual_community
@profile = @domain.profile
end
end
end