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

@ -187,12 +187,8 @@ def javascript_path(source)
#
# 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

@ -137,12 +137,8 @@ def stylesheet_path(source)
# 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

@ -4,6 +4,9 @@
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)

@ -36,6 +36,8 @@ def self.using_scss?
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