0
我的模型:加入AASM寶石後,應用程序給我的錯誤:錯誤的參數數目(假設1,預計0)
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
寶石後發生的。可能是什麼原因?