Permalink
Browse files

Pass extensions to javascript_path and stylesheet_path helpers. Closes

  • Loading branch information...
1 parent 180edc8 commit cbe918093b6ad0994cae0fce014c0d987447d9ab @spastorino spastorino committed Jan 3, 2012
@@ -69,12 +69,12 @@ def font_path(source)
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)
+ 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
@@ -158,6 +158,9 @@ def compute_host(source, request, options = {})
test "javascript_path" do
assert_match %r{/assets/application-[0-9a-f]+.js},
+ javascript_path("application")
+
+ assert_match %r{/assets/application-[0-9a-f]+.js},
javascript_path("application.js")
assert_match %r{/assets/application-[0-9a-f]+.js},
@@ -166,6 +169,9 @@ def compute_host(source, request, options = {})
test "stylesheet_path" do
assert_match %r{/assets/application-[0-9a-f]+.css},
+ stylesheet_path("application")
+
+ assert_match %r{/assets/application-[0-9a-f]+.css},
stylesheet_path("application.css")
assert_match %r{/assets/application-[0-9a-f]+.css},

0 comments on commit cbe9180

Please sign in to comment.