Class: Comatose::ApplicationController

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

Direct Known Subclasses

AdminController, BaseController

Instance Method Summary collapse

Instance Method Details

#comatose_current_userObject



7
8
9
# File 'app/controllers/comatose/application_controller.rb', line 7

def comatose_current_user
  @_current_user
end

#find_page(*args) ⇒ Object



23
24
25
# File 'app/controllers/comatose/application_controller.rb', line 23

def find_page(*args)
  Comatose::Page.send(Comatose.config.page_finder, *args)
end

#set_localeObject



12
13
14
15
16
17
18
19
20
# File 'app/controllers/comatose/application_controller.rb', line 12

def set_locale
  locale_language, locale_country = params[:locale].to_s.split('-')
  locale_language ||= 'en'
  locale_country  ||= 'US'
  locale_language.downcase!
  locale_country.upcase!
  I18n.locale = "#{locale_language}-#{locale_country}"
  logger.debug "Locale set to #{I18n.locale} from param #{params[:locale]}"
end