-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48888 from seanpdoyle/action-mailer-preview-empty…
…-states Action Mailer Preview empty states
- Loading branch information
Showing
4 changed files
with
95 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
<% @previews.each do |preview| %> | ||
<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, url_for(controller: "rails/mailers", action: "preview", path: "#{preview.preview_name}/#{email}") %></li> | ||
<% end %> | ||
</ul> | ||
<h1><%= @page_title %></h1> | ||
|
||
<% if @previews.any? %> | ||
<% @previews.each do |preview| %> | ||
<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, url_for(controller: "rails/mailers", action: "preview", path: "#{preview.preview_name}/#{email}") %></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
<% else %> | ||
<p>You have not defined any Action Mailer Previews.</p> | ||
<p>Read <%= link_to "Action Mailer Basics", "https://guides.rubyonrails.org/action_mailer_basics.html#previewing-emails" %> to learn how to define your first.</p> | ||
<% end %> |
16 changes: 11 additions & 5 deletions
16
railties/lib/rails/templates/rails/mailers/mailer.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
<h3><%= @preview.preview_name.titleize %></h3> | ||
<ul> | ||
<% @preview.emails.each do |email| %> | ||
<li><%= link_to email, url_for(controller: "rails/mailers", action: "preview", path: "#{@preview.preview_name}/#{email}") %></li> | ||
<h1><%= @page_title %></h1> | ||
|
||
<% if @preview.emails.any? %> | ||
<ul> | ||
<% @preview.emails.each do |email| %> | ||
<li><%= link_to email, url_for(controller: "rails/mailers", action: "preview", path: "#{@preview.preview_name}/#{email}") %></li> | ||
<% end %> | ||
</ul> | ||
<% else %> | ||
<p>You have not defined any actions for <%= @preview %>.</p> | ||
<p>Read <%= link_to "Action Mailer Basics", "https://guides.rubyonrails.org/action_mailer_basics.html#previewing-emails" %> to learn how to define your first.</p> | ||
<% end %> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters