Class: Editus::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Editus::ApplicationController
- Includes:
- ApplicationHelper
- Defined in:
- app/controllers/editus/application_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#authenticate(auth_configs) ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/controllers/editus/application_controller.rb', line 21 def authenticate auth_configs return true if auth_configs.blank? authenticate_with_http_basic do |u, p| session[:basic_auth_account] = u if auth_configs.include?([u, p]) end end |
#authenticate! ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/controllers/editus/application_controller.rb', line 13 def authenticate! return if editus_auth_account.present? return head 401 if editus_account_needed? return if authenticate(Editus.configuration.auth) request_http_basic_authentication end |
#set_locale ⇒ Object
29 30 31 |
# File 'app/controllers/editus/application_controller.rb', line 29 def set_locale I18n.locale = :en end |