From 64b0c8888b908ede5372e0a70cb4cb8731d372ba Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 28 Sep 2011 20:13:24 -0300 Subject: javascript_path and stylesheet_path should honor the asset pipelining --- actionpack/lib/sprockets/helpers/rails_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/lib') diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index c8c6c3ddd9..e1d8fccf04 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -65,6 +65,16 @@ module Sprockets end alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route + def javascript_path(source) + asset_path(source) + end + alias_method :path_to_javascript, :javascript_path # aliased to avoid conflicts with an javascript_path named route + + def stylesheet_path(source) + asset_path(source) + end + alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with an stylesheet_path named route + private def debug_assets? compile_assets? && (Rails.application.config.assets.debug || params[:debug_assets]) -- cgit v1.2.3