Fixed all AssetHelper methods to work with relative paths, such that...

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

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 e6428abd
*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]
......
......@@ -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
......
......@@ -37,6 +37,7 @@ def relative_url_root
JavascriptPathToTag = {
%(javascript_path("xmlhr")) => %(/javascripts/xmlhr.js),
%(javascript_path("super/xmlhr")) => %(/javascripts/super/xmlhr.js)
}
JavascriptIncludeToTag = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册