Class: Compartment::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Compartment::ApplicationController
- Defined in:
- app/controllers/compartment/application_controller.rb
Direct Known Subclasses
Compartment::Admin::AccountController, Compartment::Admin::ApplicationController, Compartment::Admin::DashboardController, Compartment::Admin::SessionsController, Compartment::Admin::SettingsController, PagesController, ThemeAssetsController
Instance Attribute Summary collapse
-
#current_site ⇒ Object
Returns the value of attribute current_site.
Instance Method Summary collapse
Instance Attribute Details
#current_site ⇒ Object
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_domain ⇒ Object
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 |