diff options
author | Richard Schneeman <richard.schneeman@gmail.com> | 2014-11-30 09:41:28 +0800 |
---|---|---|
committer | Richard Schneeman <richard.schneeman@gmail.com> | 2014-11-30 09:41:28 +0800 |
commit | b68b8cfccc1f0fc6c0aa1b27697e71d5abddd445 (patch) | |
tree | 20872bb496d3a0560018db40f4aab25791cb8dad /guides | |
parent | a975407a0a4f8bb06f8d4696de6a8b5e5a086622 (diff) | |
parent | c15d3fb0da9e90850a79dc64ebd6614618e35fec (diff) | |
download | rails-b68b8cfccc1f0fc6c0aa1b27697e71d5abddd445.tar.gz rails-b68b8cfccc1f0fc6c0aa1b27697e71d5abddd445.tar.bz2 rails-b68b8cfccc1f0fc6c0aa1b27697e71d5abddd445.zip |
Merge pull request #17850 from y-yagi/patch-2
[ci skip] fix description of url_for
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/action_mailer_basics.md | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 2e8ab83241..ba7c16aa1d 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -470,16 +470,7 @@ By using the full URL, your links will now work in your emails. #### generating URLs with `url_for` -You need to pass the `only_path: false` option when using `url_for`. This will -ensure that absolute URLs are generated because the `url_for` view helper will, -by default, generate relative URLs when a `:host` option isn't explicitly -provided. - -```erb -<%= url_for(controller: 'welcome', - action: 'greeting', - only_path: false) %> -``` +`url_for` generate full URL by default in templates. If you did not configure the `:host` option globally make sure to pass it to `url_for`. @@ -491,9 +482,6 @@ If you did not configure the `:host` option globally make sure to pass it to action: 'greeting') %> ``` -NOTE: When you explicitly pass the `:host` Rails will always generate absolute -URLs, so there is no need to pass `only_path: false`. - #### generating URLs with named routes Email clients have no web context and so paths have no base URL to form complete |