Thank you for taking care
I've got it in # 1 of Chapter 11 of RailsTutorial.

Specifically, inaccount_activation (user)in Listing 11.12
wrong number of argumentserror message is not cured.


rails db: migrate: reset

rails db: seed

Although there was a person who was cured by the above, the error contents remained the same ...

The following is what I wrote.

If i have any questions, please give me advice.

class UserMailer<ApplicationMailer
  def account_activation (user)
    @user = user
    mail to: user.email, subject: "Account activation"
  def password_reset
    @greeting = "Hi"
    mail to: "[email protected]"

The caller

# Preview all emails at http: // localhost: 3000/rails/mailers/user_mailer
class UserMailerPreview<ActionMailer :: Preview
  # Preview this email at http: // localhost: 3000/rails/mailers/user_mailer/account_activation
  def account_activation
    user = User.first
    user.activation_token = User.new_token
    UserMailer.account_activation (user)
  # Preview this email at http: // localhost: 3000/rails/mailers/user_mailer/password_reset
  def password_reset
  • Answer # 1

    wrong number of argumentsis an error in the number of arguments.

    The code for

    account_activation (user)seems to be fine, so I think it is in a different location, but I don't know just this because there is no error message details ... .

    If it's a DB problem (Is there strange data in the session?)

    rails db: drop
    rails db: create
    rails db: migrate
    It may be a good idea to run

    to erase all DBs and create them again.

Related articles