アクティベーション電子メールを送信しようとすると、引数の数に誤りがあります。ArgumentError:引数の数が正しくありません
Rails.root: /home/ubuntu/workspace Application Trace | Framework Trace | Full Trace
app/mailers/user_mailer.rb:8:in
account_activation' app/models/user.rb:66:in
send_activation_email' app/controllers/users_controller.rb:25:in `create'
user_mailer.rb:
def account_activation
@user = user
mail to: user.email, subject: "Account activation"
end
users_controller.rb:
def create
@user = User.new(user_params)
if @user.save
@user.send_activation_email
redirect_to root_url
else
render 'new'
end
end
モデル/ user.rb:
# Sends activation email.
def send_activation_email
UserMailer.account_activation(self).deliver_now
end
私の理解によると、メソッドに間違った数の引数を渡すことはありません。