Skip to content

Commit eb8998e

Browse files
authored
fix: link at mailer preview generator template
When I execute: ``` rails g mailer users/confirmations ``` The link to the preview at the comment is this: ``` http://localhost:3000/rails/mailers/users/confirmations ``` This route raises this error: ``` Unknown action Mailer preview 'users/confirmations' not found ``` So I fixed it.
1 parent 5cd1679 commit eb8998e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/generators/rspec/mailer/templates/preview.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<% module_namespacing do -%>
2-
# Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %>
2+
# Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %>_mailer
33
class <%= class_name %><%= 'Mailer' unless class_name.end_with?('Mailer') %>Preview < ActionMailer::Preview
44
<% actions.each do |action| -%>
55
6-
# Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>/<%= action %>
6+
# Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>_mailer/<%= action %>
77
def <%= action %>
88
<%= class_name.sub(/(Mailer)?$/, 'Mailer') %>.<%= action %>
99
end

0 commit comments

Comments
 (0)