1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

document that default_url_options is cached per request [ci skip]

This commit is contained in:
Xavier Noria 2015-06-15 21:38:15 +02:00
parent 5c517ee442
commit c865b8298f

View file

@ -185,7 +185,9 @@ end
These options will be used as a starting point when generating URLs, so it's possible they'll be overridden by the options passed to `url_for` calls. These options will be used as a starting point when generating URLs, so it's possible they'll be overridden by the options passed to `url_for` calls.
If you define `default_url_options` in `ApplicationController`, as in the example above, it will be used for all URL generation. The method can also be defined in a specific controller, in which case it only affects URLs generated there. If you define `default_url_options` in `ApplicationController`, as in the example above, these defaults will be used for all URL generation. The method can also be defined in a specific controller, in which case it only affects URLs generated there.
In a given request, the method is not actually called for every single generated URL; for performance reasons, the returned hash is cached, there is at most one invocation per request.
### Strong Parameters ### Strong Parameters