Skip to content

Commit

Permalink
Fixed all AssetHelper methods to work with relative paths, such that …
Browse files Browse the repository at this point in the history
…javascript_include_tag('stdlib/standard') will look in /javascripts/stdlib/standard instead of '/stdlib/standard/' #1963

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Sep 8, 2005
1 parent e6428ab commit 3c3d936
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*

* Fixed all AssetHelper methods to work with relative paths, such that javascript_include_tag('stdlib/standard') will look in /javascripts/stdlib/standard instead of '/stdlib/standard/' #1963

* Avoid extending view instance with helper modules each request. Closes #1979

* Performance improvements to CGI methods. Closes #1980 [Skaes]
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -119,7 +119,7 @@ def image_tag(source, options = {})

private
def compute_public_path(source, dir, ext)
source = "/#{dir}/#{source}" unless source.include?("/")
source = "/#{dir}/#{source}" unless source.first == "/" || source.include?(":")
source = "#{source}.#{ext}" unless source.include?(".")
source = "#{@request.relative_url_root}#{source}" unless %r{^[-a-z]+://} =~ source
ActionController::Base.asset_host + source
Expand Down
1 change: 1 addition & 0 deletions actionpack/test/template/asset_tag_helper_test.rb
Expand Up @@ -37,6 +37,7 @@ def relative_url_root

JavascriptPathToTag = {
%(javascript_path("xmlhr")) => %(/javascripts/xmlhr.js),
%(javascript_path("super/xmlhr")) => %(/javascripts/super/xmlhr.js)
}

JavascriptIncludeToTag = {
Expand Down

0 comments on commit 3c3d936

Please sign in to comment.