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
challah-0.9.0 vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
actionpack-3.2.10 lib/action_controller/railtie.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
jquery_regex-0.0.3 vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
jquery_regex-0.0.1 vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
challah-rolls-0.2.0 vendor/bundle/gems/actionpack-3.2.8/lib/action_controller/railtie.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/actionpack-3.2.8/lib/action_controller/railtie.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/actionpack-3.2.7/lib/action_controller/railtie.rb
challah-rolls-0.2.0 vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
challah-rolls-0.2.0 vendor/bundle/gems/actionpack-3.2.7/lib/action_controller/railtie.rb
challah-0.8.3 vendor/bundle/gems/actionpack-3.2.9/lib/action_controller/railtie.rb
challah-0.8.3 vendor/bundle/gems/actionpack-3.2.8/lib/action_controller/railtie.rb
actionpack-3.2.9 lib/action_controller/railtie.rb