mirror of https://github.com/rails/rails
Remaining cleanup from changes to AssetTagHelper
This commit is contained in:
parent
72c7160d0d
commit
00be5bd75d
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue