Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Changed RAILS_ASSET_HOST to become ActionController::Base.asset_host
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1289 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed May 6, 2005
1 parent 358a669 commit c971c24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions actionpack/lib/action_controller/base.rb
Expand Up @@ -215,6 +215,12 @@ class Base
@@view_controller_internals = true
cattr_accessor :view_controller_internals

# Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets,
# and images to a dedicated asset server away from the main web server. Example:
# ActionController::Base.asset_host = "http://assets.example.com"
@@asset_host = ""
cattr_accessor :asset_host

# All requests are considered local by default, so everyone will be exposed to detailed debugging screens on errors.
# When the application is ready to go public, this should be set to false, and the protected method <tt>local_request?</tt>
# should instead be implemented in the controller to determine when debugging screens should be shown.
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -110,7 +110,7 @@ def compute_public_path(source, dir, ext)
source = "/#{dir}/#{source}" unless source.include?("/")
source = "#{source}.#{ext}" unless source.include?(".")
source = "#{@request.relative_url_root}#{source}"
defined?(RAILS_ASSET_HOST) ? RAILS_ASSET_HOST + source : source
@controller.asset_host + source
end
end
end
Expand Down

0 comments on commit c971c24

Please sign in to comment.