Sha256: 5f8df83d6e7216cafa67546918f7133ac0815fe6b122fe83eb51a6aa06808202

Contents?: true

Size: 1.45 KB

Versions: 96

Compression:

Stored size: 1.45 KB

Contents

require "action_view"
require "rails"

module ActionView
  # = Action View Railtie
  class Railtie < Rails::Railtie # :nodoc:
    config.action_view = ActiveSupport::OrderedOptions.new
    config.action_view.embed_authenticity_token_in_remote_forms = false

    config.eager_load_namespaces << ActionView

    initializer "action_view.embed_authenticity_token_in_remote_forms" do |app|
      ActiveSupport.on_load(:action_view) do
        ActionView::Helpers::FormTagHelper.embed_authenticity_token_in_remote_forms =
          app.config.action_view.delete(:embed_authenticity_token_in_remote_forms)
      end
    end

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

    initializer "action_view.set_configs" do |app|
      ActiveSupport.on_load(:action_view) do
        app.config.action_view.each do |k,v|
          send "#{k}=", v
        end
      end
    end

    initializer "action_view.caching" do |app|
      ActiveSupport.on_load(:action_view) do
        if app.config.action_view.cache_template_loading.nil?
          ActionView::Resolver.caching = app.config.cache_classes
        end
      end
    end

    initializer "action_view.setup_action_pack" do |app|
      ActiveSupport.on_load(:action_controller) do
        ActionView::RoutingUrlFor.send(:include, ActionDispatch::Routing::UrlFor)
      end
    end

    rake_tasks do
      load "action_view/tasks/dependencies.rake"
    end
  end
end

Version data entries

96 entries across 92 versions & 9 rubygems

Version Path
actionview-4.2.4 lib/action_view/railtie.rb
actionview-4.1.13 lib/action_view/railtie.rb
actionview-4.2.4.rc1 lib/action_view/railtie.rb
actionview-4.1.13.rc1 lib/action_view/railtie.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/actionview-4.2.3/lib/action_view/railtie.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/actionview-4.2.3/lib/action_view/railtie.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/actionview-4.2.1/lib/action_view/railtie.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/actionview-4.2.2/lib/action_view/railtie.rb
actionview-4.2.3 lib/action_view/railtie.rb
actionview-4.1.12 lib/action_view/railtie.rb
actionview-4.2.3.rc1 lib/action_view/railtie.rb
actionview-4.1.12.rc1 lib/action_view/railtie.rb
actionview-4.2.2 lib/action_view/railtie.rb
actionview-4.1.11 lib/action_view/railtie.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/actionview-4.2.1/lib/action_view/railtie.rb
actionview-4.1.10 lib/action_view/railtie.rb
actionview-4.2.1 lib/action_view/railtie.rb
actionview-4.1.10.rc4 lib/action_view/railtie.rb
actionview-4.2.1.rc4 lib/action_view/railtie.rb
actionview-4.1.10.rc3 lib/action_view/railtie.rb