Sha256: c807eb49cf6f59744ba87392cf1bf263607d31321446a517f967f454ff17bc85

Contents?: true

Size: 1.2 KB

Versions: 39

Compression:

Stored size: 1.2 KB

Contents

require "action_view"
require "rails"

module ActionView
  # = Action View Railtie
  class Railtie < Rails::Railtie
    config.action_view = ActiveSupport::OrderedOptions.new
    config.action_view.stylesheet_expansions = {}
    config.action_view.javascript_expansions = { :defaults => ['prototype', 'effects', 'dragdrop', 'controls', 'rails'] }

    initializer "action_view.cache_asset_timestamps" do |app|
      unless app.config.cache_classes
        ActiveSupport.on_load(:action_view) do
          ActionView::Helpers::AssetTagHelper.cache_asset_timestamps = false
        end
      end
    end

    initializer "action_view.javascript_expansions" do |app|
      ActiveSupport.on_load(:action_view) do
        ActionView::Helpers::AssetTagHelper.register_javascript_expansion(
          app.config.action_view.delete(:javascript_expansions)
        )

        ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion(
          app.config.action_view.delete(:stylesheet_expansions)
        )
      end
    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
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
actionpack-3.0.8.rc4 lib/action_view/railtie.rb
actionpack-3.0.8.rc2 lib/action_view/railtie.rb
actionpack-3.0.8.rc1 lib/action_view/railtie.rb
actionpack-3.0.7 lib/action_view/railtie.rb
actionpack-3.0.7.rc2 lib/action_view/railtie.rb
actionpack-3.0.7.rc1 lib/action_view/railtie.rb
actionpack-3.0.6 lib/action_view/railtie.rb
actionpack-3.0.6.rc2 lib/action_view/railtie.rb
actionpack-3.0.6.rc1 lib/action_view/railtie.rb
actionpack-3.0.5 lib/action_view/railtie.rb
actionpack-3.0.5.rc1 lib/action_view/railtie.rb
actionpack-3.0.4 lib/action_view/railtie.rb
actionpack-3.0.4.rc1 lib/action_view/railtie.rb
actionpack-3.0.3 lib/action_view/railtie.rb
actionpack-3.0.2 lib/action_view/railtie.rb
actionpack-3.0.1 lib/action_view/railtie.rb
actionpack-3.0.0 lib/action_view/railtie.rb
actionpack-3.0.0.rc2 lib/action_view/railtie.rb
actionpack-3.0.0.rc lib/action_view/railtie.rb