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.22.5 lib/action_controller/railtie.rb
actionpack-3.2.22.4 lib/action_controller/railtie.rb
actionpack-3.2.22.3 lib/action_controller/railtie.rb
actionpack-3.2.22.2 lib/action_controller/railtie.rb
actionpack-3.2.22.1 lib/action_controller/railtie.rb
active_mailer-0.0.10 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.22 lib/action_controller/railtie.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.12/lib/action_controller/railtie.rb
actionpack-3.2.21 lib/action_controller/railtie.rb
actionpack-3.2.20 lib/action_controller/railtie.rb
actionpack-3.2.19 lib/action_controller/railtie.rb
actionpack-3.2.18 lib/action_controller/railtie.rb
actionpack-3.2.17 lib/action_controller/railtie.rb
actionpack-3.2.16 lib/action_controller/railtie.rb
actionpack-3.2.15 lib/action_controller/railtie.rb
actionpack-3.2.15.rc3 lib/action_controller/railtie.rb
actionpack-3.2.15.rc2 lib/action_controller/railtie.rb
actionpack-3.2.15.rc1 lib/action_controller/railtie.rb
actionpack-3.2.14 lib/action_controller/railtie.rb
actionpack-3.2.14.rc2 lib/action_controller/railtie.rb