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

This commit is contained in:
Matt Jankowski
2011-06-21 09:04:28 -04:00
committed by Xavier Noria
parent 57bdf7eabf
commit bb679d2cae

View File

@@ -123,8 +123,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>: