Remaining cleanup from changes to AssetTagHelper

This commit is contained in:
tomhuda 2011-05-23 23:30:06 -07:00 committed by wycats
parent 72c7160d0d
commit 00be5bd75d
4 changed files with 9 additions and 12 deletions

View File

@ -187,12 +187,8 @@ module ActionView
#
# javascript_include_tag :all, :cache => true, :recursive => true
def javascript_include_tag(*sources)
if config.use_sprockets
sprockets_javascript_include_tag(*sources)
else
@javascript_include ||= JavascriptIncludeTag.new(config, asset_paths)
@javascript_include.include_tag(*sources)
end
@javascript_include ||= JavascriptIncludeTag.new(config, asset_paths)
@javascript_include.include_tag(*sources)
end
end
end

View File

@ -137,12 +137,8 @@ module ActionView
# stylesheet_link_tag :all, :concat => true
#
def stylesheet_link_tag(*sources)
if config.use_sprockets
sprockets_stylesheet_link_tag(*sources)
else
@stylesheet_include ||= StylesheetIncludeTag.new(config, asset_paths)
@stylesheet_include.include_tag(*sources)
end
@stylesheet_include ||= StylesheetIncludeTag.new(config, asset_paths)
@stylesheet_include.include_tag(*sources)
end
end

View File

@ -4,6 +4,9 @@ require "action_view/helpers/asset_tag_helper"
module Sprockets
module Helpers
module RailsHelper
extend ActiveSupport::Concern
include ActionView::Helpers::AssetTagHelper
def asset_paths
@asset_paths ||= begin
config = self.config if respond_to?(:config)

View File

@ -36,6 +36,8 @@ module Sprockets
app.assets = asset_environment(app)
ActiveSupport.on_load(:action_view) do
include ::Sprockets::Helpers::RailsHelper
app.assets.context_class.instance_eval do
include ::Sprockets::Helpers::RailsHelper
end