Permalink
Browse files

Merge pull request #10 from elia/patch-1

Improve rails_helper documentation
  • Loading branch information...
2 parents 2d41700 + 30eb26e commit 1b0d56831b54b97c66c8055b0c9f9b443a1c63cf @guilleiguaran guilleiguaran committed May 12, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/sprockets/rails/helpers/rails_helper.rb
@@ -67,17 +67,17 @@ def image_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
+ alias_method :path_to_font, :font_path # aliased to avoid conflicts with a 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
+ alias_method :path_to_javascript, :javascript_path # aliased to avoid conflicts with a javascript_path named route
def stylesheet_path(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
+ alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with a stylesheet_path named route
private
def debug_assets?
@@ -120,6 +120,8 @@ class AssetPaths < ::ActionView::AssetPaths #:nodoc:
class AssetNotPrecompiledError < StandardError; end
+ # Retrieve the asset path on disk, for processed files +ext+ should
+ # contain the final extension (e.g. +js+ for <tt>*.js.coffee</tt>).
def asset_for(source, ext)
source = source.to_s
return nil if is_uri?(source)

0 comments on commit 1b0d568

Please sign in to comment.