lib/sprockets/helpers/rails_helper.rb in actionpack-3.2.0.rc1 vs lib/sprockets/helpers/rails_helper.rb in actionpack-3.2.0.rc2
- old
+ new
@@ -61,17 +61,22 @@
def image_path(source)
path_to_asset(source)
end
alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route
- def javascript_path(source)
+ def font_path(source)
path_to_asset(source)
end
+ alias_method :path_to_font, :font_path # aliased to avoid conflicts with an font_path named route
+
+ def javascript_path(source)
+ path_to_asset(source, :ext => 'js')
+ end
alias_method :path_to_javascript, :javascript_path # aliased to avoid conflicts with an javascript_path named route
def stylesheet_path(source)
- path_to_asset(source)
+ path_to_asset(source, :ext => 'css')
end
alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with an stylesheet_path named route
private
def debug_assets?
@@ -111,14 +116,9 @@
class AssetPaths < ::ActionView::AssetPaths #:nodoc:
attr_accessor :asset_environment, :asset_prefix, :asset_digests, :compile_assets, :digest_assets
class AssetNotPrecompiledError < StandardError; end
-
- # Return the filesystem path for the source
- def compute_source_path(source, ext)
- asset_for(source, ext)
- end
def asset_for(source, ext)
source = source.to_s
return nil if is_uri?(source)
source = rewrite_extension(source, nil, ext)