so I am working on a rails engine and generated a mailer which put my views in
app/
views/
my_engine/
user_mailer/
account_activation.html.erb
account_activation.text.erb
to configure the dummy app to display the previews i added
test/dummy/config/environments/development.rb
config.action_mailer.preview_path = MSearcher::Engine.root.join('test/mailers')
test/mailers/previews/my_engine/user_mailer_preview.rb
module MyEngine
class UserMailerPreview < ActionMailer::Preview
def account_activation
User.first
UserMailer.account_activation(user)
end
end
end
now if I create my mailer
/app/mailers/my_engine/user_mailer
module MyEngine
class UserMailer < Application Mailer
def account_activation(user)
mail to: user.email, subject: "Account Activation"
end
end
end
with this i can navigate to localhost:3000/rails/mailers/my_engine/users_mailer/account_activation
where I get the error
Template is missing
Missing template layouts/mailer with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee]}.
Searched in: *
"/home/me/workspace/rails/my_engine/test/dummy/app/views" *
"/home/me/workspace/rails/my_engine/app/views"
so the default behavior is looking for my templates in the folder above the one that it should be. How can I configure the proper behavior?