Class: Compartment::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/compartment/application_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_siteObject

Returns the value of attribute current_site.



4
5
6
# File 'app/controllers/compartment/application_controller.rb', line 4

def current_site
  @current_site
end

Instance Method Details

#find_site_by_domainObject



8
9
10
11
12
13
# File 'app/controllers/compartment/application_controller.rb', line 8

def find_site_by_domain
  @current_site ||= Site.find_by_domain(env['SERVER_NAME'])
  unless @current_site
    render 'compartment/errors/unknown_site', status: 404, layout: false
  end
end