vendredi 15 juillet 2016

Missing template layouts/mailer with {:locale=>[:en], :formats=>[:html],

I'm following michael harlt rails tutorial but i get this error

Missing template layouts/mailer with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :jbuilder]}. Searched in: * "/home/ubuntu/workspace/app/views"

when previewing account activation

This is my user_mailer.rb

class UserMailer < ApplicationMailer

  def account_activation(user)
    @user = user
    mail to: user.email,  subject: "Account activation"
  end

  def password_reset
    @greeting = "Hi"

    mail to: "to@example.org"
  end
end

and the error highlights the line that says

mail to: user.email,  subject: "Account activation"

I tried adding layout 'mailer' in user_mailer.rb but it doesn't work.

Aucun commentaire:

Enregistrer un commentaire