Class: ActionController::Base
Public Class Methods
after_init_locale (*filters, &block)
Append a block which is called after initializing locale on each WWW request.
(e.g.)
class ApplicationController < ActionController::Base def after_init_i18n L10nClass.new(locale_candidates) end after_init_locale :after_init_i18n # ... end
# File lib/locale_rails/action_controller.rb, line 74 74: def self.after_init_locale(*filters, &block) 75: locale_filter_chain.append_filter_to_chain(filters, :after, &block) 76: end
before_init_locale (*filters, &block)
Append a block which is called before initializing locale on each WWW request.
(e.g.)
class ApplicationController < ActionController::Base def before_init_i18n if (cookies["lang"].nil? or cookies["lang"].empty?) params["lang"] = "ko_KR" end end before_init_locale :before_init_i18n # ... end
# File lib/locale_rails/action_controller.rb, line 60 60: def self.before_init_locale(*filters, &block) 61: locale_filter_chain.append_filter_to_chain(filters, :before, &block) 62: end