aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/templates
diff options
context:
space:
mode:
authorRemo Mueller <remosm@gmail.com>2015-02-26 09:29:01 -0500
committerRemo Mueller <remosm@gmail.com>2015-04-30 10:12:00 -0400
commitf5132c19d52c4457aa2e09c647d2f52a73966c68 (patch)
treebf6fb095c11c39f3da1468e720a50119d97004e3 /railties/lib/rails/templates
parent8fd46330095b3c1a5d7461c194028e22d9b77b97 (diff)
downloadrails-f5132c19d52c4457aa2e09c647d2f52a73966c68.tar.gz
rails-f5132c19d52c4457aa2e09c647d2f52a73966c68.tar.bz2
rails-f5132c19d52c4457aa2e09c647d2f52a73966c68.zip
Mailer preview now uses `url_for` to fix links to emails for apps running on a subdirectory, closes #19092.
Diffstat (limited to 'railties/lib/rails/templates')
-rw-r--r--railties/lib/rails/templates/rails/mailers/index.html.erb4
-rw-r--r--railties/lib/rails/templates/rails/mailers/mailer.html.erb2
2 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/templates/rails/mailers/index.html.erb b/railties/lib/rails/templates/rails/mailers/index.html.erb
index c4c9757d57..000930c039 100644
--- a/railties/lib/rails/templates/rails/mailers/index.html.erb
+++ b/railties/lib/rails/templates/rails/mailers/index.html.erb
@@ -1,8 +1,8 @@
<% @previews.each do |preview| %>
-<h3><%= link_to preview.preview_name.titleize, "/rails/mailers/#{preview.preview_name}" %></h3>
+<h3><%= link_to preview.preview_name.titleize, url_for(controller: "rails/mailers", action: "preview", path: preview.preview_name) %></h3>
<ul>
<% preview.emails.each do |email| %>
-<li><%= link_to email, "/rails/mailers/#{preview.preview_name}/#{email}" %></li>
+<li><%= link_to email, url_for(controller: "rails/mailers", action: "preview", path: "#{preview.preview_name}/#{email}") %></li>
<% end %>
</ul>
<% end %>
diff --git a/railties/lib/rails/templates/rails/mailers/mailer.html.erb b/railties/lib/rails/templates/rails/mailers/mailer.html.erb
index 607c8d1677..c12ead0f90 100644
--- a/railties/lib/rails/templates/rails/mailers/mailer.html.erb
+++ b/railties/lib/rails/templates/rails/mailers/mailer.html.erb
@@ -1,6 +1,6 @@
<h3><%= @preview.preview_name.titleize %></h3>
<ul>
<% @preview.emails.each do |email| %>
-<li><%= link_to email, "/rails/mailers/#{@preview.preview_name}/#{email}" %></li>
+<li><%= link_to email, url_for(controller: "rails/mailers", action: "preview", path: "#{@preview.preview_name}/#{email}") %></li>
<% end %>
</ul>