My model:
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
And the Controller:
class LeadsController < ApplicationController
...
def create
@lead = @leads.new lead_params
if @lead.save
flash[:success] = "Lead saved successfully"
render 'show'
end
...
end
When trying to create a new lead, it gives me error wrong number of arguments (given 1, expected 0)
. All this happened after I added aasm
gem. What could be the reason?