Sha256: 73284ed5dd4787fd2458fa791294787c30f5416315aa0598f057f56bb737ce23

Contents?: true

Size: 1.84 KB

Versions: 151

Compression:

Stored size: 1.84 KB

Contents

require "rails"
require "action_controller"
require "action_dispatch/railtie"
require "action_view/railtie"
require "abstract_controller/railties/routes_helpers"
require "action_controller/railties/paths"

module ActionController
  class Railtie < Rails::Railtie
    config.action_controller = ActiveSupport::OrderedOptions.new

    initializer "action_controller.logger" do
      ActiveSupport.on_load(:action_controller) { self.logger ||= Rails.logger }
    end

    initializer "action_controller.initialize_framework_caches" do
      ActiveSupport.on_load(:action_controller) { self.cache_store ||= RAILS_CACHE }
    end

    initializer "action_controller.assets_config", :group => :all do |app|
      app.config.action_controller.assets_dir ||= app.config.paths["public"].first
    end

    initializer "action_controller.set_configs" do |app|
      paths   = app.config.paths
      options = app.config.action_controller

      options.javascripts_dir      ||= paths["public/javascripts"].first
      options.stylesheets_dir      ||= paths["public/stylesheets"].first
      options.page_cache_directory ||= paths["public"].first

      # make sure readers methods get compiled
      options.asset_path           ||= app.config.asset_path
      options.asset_host           ||= app.config.asset_host
      options.relative_url_root    ||= app.config.relative_url_root

      ActiveSupport.on_load(:action_controller) do
        include app.routes.mounted_helpers
        extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
        extend ::ActionController::Railties::Paths.with(app)
        options.each { |k,v| send("#{k}=", v) }
      end
    end

    initializer "action_controller.compile_config_methods" do
      ActiveSupport.on_load(:action_controller) do
        config.compile_methods! if config.respond_to?(:compile_methods!)
      end
    end
  end
end

Version data entries

151 entries across 112 versions & 18 rubygems

Version Path
actionpack-3.2.13 lib/action_controller/railtie.rb
actionpack-3.2.13.rc2 lib/action_controller/railtie.rb
actionpack-3.2.13.rc1 lib/action_controller/railtie.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_controller/railtie.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_controller/railtie.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_controller/railtie.rb
actionpack-3.2.12 lib/action_controller/railtie.rb
graphael-on-rails-0.5.1 vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
graphael-on-rails-0.0.1 vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
challah-0.9.1.beta.3 vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
devise_sociable-0.1.0 vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
backbone-queryparams-rails-0.0.1 vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
railscast-assets-0.0.2 vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
railscast-assets-0.0.2 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
backbone-deep-rails-0.0.1 vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
challah-0.9.1.beta vendor/bundle/gems/actionpack-3.2.11/lib/action_controller/railtie.rb
actionpack-3.2.11 lib/action_controller/railtie.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.10/lib/action_controller/railtie.rb