Skip to content

Commit

Permalink
Improve rails_helper documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed May 12, 2012
1 parent 2d41700 commit 30eb26e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/sprockets/rails/helpers/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 30eb26e

Please sign in to comment.