gist: 12740 Download_button fork
public
Public Clone URL: git://gist.github.com/12740.git
Text only
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
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
 
class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  #layout 'application'
  layout :determine_layout
  include AuthenticatedSystem
  
  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery # :secret => 'fa38fd50719b4d4f6a214be7301a4801'
  
  # See ActionController::Base for details
  # Uncomment this to filter the contents of submitted sensitive data parameters
  # from your application log (in this case, all fields with names like "password").
  # filter_parameter_logging :password
  protected
 
    def determine_layout
      if File.exists?(File.join(RAILS_ROOT, "app/views/layouts/#{request.domain}.html.erb"))
        request.domain
      else
        'application'
      end
    end
end
 
 

Owner

esparkman

Revisions