aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorManuel Meurer <manuel@krautcomputing.com>2014-05-31 17:02:49 +0200
committerManuel Meurer <manuel@krautcomputing.com>2014-05-31 17:06:36 +0200
commitf7b0f4f1e0a732ff70f3704007536bf1c49fce12 (patch)
tree55f1950f2df9c0d03d3deba860b1924d5f5abffd /actionview
parent3051356a8005518392f3414184daf933f5597092 (diff)
downloadrails-f7b0f4f1e0a732ff70f3704007536bf1c49fce12.tar.gz
rails-f7b0f4f1e0a732ff70f3704007536bf1c49fce12.tar.bz2
rails-f7b0f4f1e0a732ff70f3704007536bf1c49fce12.zip
Update documentation for setting asset_host to a Proc, mention that the request parameter might not be supplied [ci skip]
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/asset_url_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb
index d86e7e490c..006b15be91 100644
--- a/actionview/lib/action_view/helpers/asset_url_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_url_helper.rb
@@ -88,9 +88,12 @@ module ActionView
# still sending assets for plain HTTP requests from asset hosts. If you don't
# have SSL certificates for each of the asset hosts this technique allows you
# to avoid warnings in the client about mixed media.
+ # Note that the request parameter might not be supplied, e.g. when the assets
+ # are precompiled via a Rake task. Make sure to use a Proc instead of a lambda,
+ # since a Proc allows missing parameters and sets them to nil.
#
# config.action_controller.asset_host = Proc.new { |source, request|
- # if request.ssl?
+ # if request && request.ssl?
# "#{request.protocol}#{request.host_with_port}"
# else
# "#{request.protocol}assets.example.com"