Sha256: bb1aa774425d11f14511a13c9e3eca858c031e2ba02adef132b641ece71e9d7d

Contents?: true

Size: 622 Bytes

Versions: 3

Compression:

Stored size: 622 Bytes

Contents

module Comatose
  class ApplicationController < ActionController::Base

    before_filter :set_locale


    def comatose_current_user
      @_current_user
    end


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


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



  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
comatose-rubyisbeautiful-3.0.2 app/controllers/comatose/application_controller.rb
comatose-rubyisbeautiful-3.0.1 app/controllers/comatose/application_controller.rb
comatose-rubyisbeautiful-3.0.0 app/controllers/comatose/application_controller.rb