我的模型:
class Lead < ApplicationRecord
include AASM
aasm column: 'status' do
state :new, initial: true
state :valid
event :submit do
transitions from: :new, to: :valid
end
...
end
...
end
和控制器:
class LeadsController < ApplicationController
...
def create
@lead = @leads.new lead_params
if @lead.save
flash[:success] = "Lead saved successfully"
render 'show'
end
...
end
尝试创建新潜在客户时,它给了我错误wrong number of arguments (given 1, expected 0)
。这一切都是在我添加aasm
gem 之后发生的。可能是什么原因?