Я пытаюсь настроить электронную почту своего устройства.
Я сделал следующее:
routes.rb
devise_for :users, :controllers => { :registrations => "registrations", :sessions => "sessions", :confirmations => "confirmations", :passwords => "passwords", :omniauth_callbacks => "authentications" }
конец
devise.rb
config.mailer = "UserMailer"
класс UserMailer
include Devise::Mailers::Helpers # Needed for Devise
default from: "default@mydomain.com"
def confirmation_instructions(record)
@resource = record
mail( :from => "default@mydomain.com",
:to => record.email,
:subject => "XXXXXXXXX"
)
end
confirmation_instructions.html.erb
<p><%= link_to 'Confirm my account', user_confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
Это приводит к ошибке:
NameError in Registrations#create
Showing /Users/xxx/Sites/x/app/views/user_mailer/confirmation_instructions.html.erb where line #5 raised:
undefined local variable or method `controller' for #<UserMailer:0x007fac55fe3ba8>
Есть идеи, что здесь не так?
Спасибо