diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/sprockets_helper.rb | 14 | ||||
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 21 | ||||
-rw-r--r-- | actionpack/lib/sprockets/railtie.rb | 1 |
4 files changed, 15 insertions, 23 deletions
diff --git a/actionpack/lib/action_view/helpers.rb b/actionpack/lib/action_view/helpers.rb index 78a68db282..262e0f1010 100644 --- a/actionpack/lib/action_view/helpers.rb +++ b/actionpack/lib/action_view/helpers.rb @@ -22,7 +22,6 @@ module ActionView #:nodoc: autoload :RecordTagHelper autoload :RenderingHelper autoload :SanitizeHelper - autoload :SprocketsHelper autoload :TagHelper autoload :TextHelper autoload :TranslationHelper @@ -53,7 +52,6 @@ module ActionView #:nodoc: include RecordTagHelper include RenderingHelper include SanitizeHelper - include SprocketsHelper include TagHelper include TextHelper include TranslationHelper diff --git a/actionpack/lib/action_view/helpers/sprockets_helper.rb b/actionpack/lib/action_view/helpers/sprockets_helper.rb deleted file mode 100644 index 04558438f7..0000000000 --- a/actionpack/lib/action_view/helpers/sprockets_helper.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'uri' -require 'action_view/helpers/asset_paths' - -module ActionView - module Helpers - module SprocketsHelper - def debug_assets? - params[:debug_assets] == '1' || - params[:debug_assets] == 'true' - end - - end - end -end diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 5f2854995f..3b64be67d9 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -1,3 +1,6 @@ +require "action_view/helpers/asset_paths" +require "action_view/helpers/asset_tag_helper" + module Sprockets module Helpers module RailsHelper @@ -9,12 +12,6 @@ module Sprockets end end - def asset_path(source, default_ext = nil, body = false) - source = source.logical_path if source.respond_to?(:logical_path) - path = asset_paths.compute_public_path(source, 'assets', default_ext, true) - body ? "#{path}?body=1" : path - end - def javascript_include_tag(source, options = {}) debug = options.key?(:debug) ? options.delete(:debug) : debug_assets? body = options.key?(:body) ? options.delete(:body) : false @@ -53,6 +50,18 @@ module Sprockets end end + private + def debug_assets? + params[:debug_assets] == '1' || + params[:debug_assets] == 'true' + end + + def asset_path(source, default_ext = nil, body = false) + source = source.logical_path if source.respond_to?(:logical_path) + path = asset_paths.compute_public_path(source, 'assets', default_ext, true) + body ? "#{path}?body=1" : path + end + class AssetPaths < ActionView::Helpers::AssetPaths #:nodoc: def compute_public_path(source, dir, ext=nil, include_host=true) super(source, 'assets', ext, include_host) diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index 66354c9789..43ebf529e9 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -35,7 +35,6 @@ module Sprockets ActiveSupport.on_load(:action_view) do app.assets.context_class.instance_eval do - include ::ActionView::Helpers::SprocketsHelper include ::Sprockets::Helpers::RailsHelper end end |