Thank you for taking care
I've got it in # 1 of Chapter 11 of RailsTutorial.
account_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" end def password_reset @greeting = "Hi" mail to: "[email protected]" end end
# 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) end # Preview this email at http: // localhost: 3000/rails/mailers/user_mailer/password_reset def password_reset UserMailer.password_reset end end
Answer # 1
The code for
wrong number of argumentsis an error in the number of arguments.
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?)
It may be a good idea to run
rails db: drop rails db: create rails db: migrate
to erase all DBs and create them again.
- ruby on rails - wrong number of arguments (given 1, expected 0) is displayed when updating
- ruby - the wrong number of arguments (given 5, expected 2) is not fixed
- ruby on rails - dealing with wrong number of arguments (given 1, expected 2)
- ruby - wrong number of arguments (given 1, expected 3) error message is output when adding a column
- ruby - can't find the cause of we're sorry, but something went wrong in rails production environment
- meaning of ruby number 
- i'm writing a program to increase the number of 1 + 2 + 3 + by 1 using the while statement in ruby, but it does not work
- ruby - about the case where the array number of the added form of rails cocoon is strange
- in ruby, addition to the value of the hash with the number captured by the regular expression as the key does not work
- ruby - we're sorry, but something went wrong
- ruby - my app is heroku, but the page "we're sorry, but something went wrong"
- ruby: what to do if something other than a number is entered
- ruby - i want to get a random number token with securerandom when creating a model instance with rails
- ruby - "we're sorry, but something went wrong" is displayed even though the automatic deployment was successful
- ruby on rails - get results in argumenterror (wrong number of arguments (given 1, expected 0)):
- cannot display the total number of elements that the user also has in ruby on rails
- ruby on rails 5 - if statement is wrong in each statement
- ruby - i want to test that the number contained in the character string is 3 digits with rspec!
- ruby on rails - [rails] how to specify the number of date_select to be displayed
- ruby on rails - i want to display the number of people in the group
- ruby - i want to display only the image of the logged-in user when executing the search function
- ruby - i want to associate user and post using has_many belongs_to
- ruby - using allow_nil: true causes an error
- gem cannot be read even though "bundle install" was successful in the local development environment of ruby on rails (
- ruby - rails console error
- [ruby on rails] relationship between transaction and pessimistic lock/optimistic lock
- ruby version error on ec2 on aws
- ruby - i can't save values to the database with rails c