Class: ActionController::Base

### Home Classes Methods

### In Files

- lib/locale_rails/action_controller/base.rb

### Parent

Object

### Methods

- ::after_init_locale
- ::before_init_locale

### Class/Module Index

Quicksearch

- ActionController
- ActionController::Base
- ActionController::Caching
- ActionController::Caching::Fragments
- ActionView
- ActionView::PathSet
- I18n
- LocaleRails

No matching classes.

# ActionController::Base

### Public Class Methods

after_init_locale(*filters, &block) click to toggle source

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/base.rb, line 75
    def self.after_init_locale(*filters, &block)
      locale_filter_chain.append_filter_to_chain(filters, :after, &block)
    end

before_init_locale(*filters, &block) click to toggle source

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/base.rb, line 61
    def self.before_init_locale(*filters, &block)
      locale_filter_chain.append_filter_to_chain(filters, :before, &block)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.