When I did "rails s", I got an error about the destroy method, and I had a hard time not knowing where to fix it, so I will write it as a record.
Error message
persistence.rb:325:in `destroy': wrong number of arguments (given 0, expected 1) (ArgumentError)
There was a problem with how to write in the model.
user.rb
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
attachment :profile_image
has_many :tasks, dependent: destroy
end
It's very simple, but I solved it by fixing the description of the file in the model.
user.rb
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
attachment :profile_image
has_many :tasks, dependent: :destroy
end
Reference article https://teratail.com/questions/244096
Recommended Posts