Permalink
Browse files

elaborate details on why to use _url instead of _path in mailers

  • Loading branch information...
1 parent c01c954 commit 1f4fb6f6355bdf8f16f52c8803d8d26ddb1a81ef @mjankowski mjankowski committed Jun 21, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionmailer/lib/action_mailer/base.rb
@@ -122,8 +122,9 @@ module ActionMailer #:nodoc:
#
# <%= users_url(:host => "example.com") %>
#
- # You want to avoid using the <tt>name_of_route_path</tt> form of named routes because it doesn't
- # make sense to generate relative URLs in email messages.
+ # You should use the <tt>named_route_url</tt> style (which generates absolute URLs) and avoid using the
+ # <tt>named_route_path</tt> style (which generates relative URLs), since clients reading the mail will
+ # have no concept of a current URL from which to determine a relative path.
#
# It is also possible to set a default host that will be used in all mailers by setting the <tt>:host</tt>
# option as a configuration option in <tt>config/application.rb</tt>:

0 comments on commit 1f4fb6f

Please sign in to comment.