0
나는 aasm ruby gem과 rails를 사용해도 매개 변수를 전달하려고합니다. 그러나 문서 예제를 따르려고 할 때마다 Wrong number of arguments. Expected 0, got 2.
이됩니다. 내가 도대체 뭘 잘못하고있는 겁니까?Aasm Gem 이벤트로 params 전달하기
class Foo < ActiveRecord::Base
include AASM
aasm column: :status do
state :stopped, initial: true
# TODO: if post fails, should this remain in_progress?
state :running
event :run, aasm_fire_event: :do_something do
transitions from: :stopped, to: :running
end
end
def do_something(list_of_things)
.... #stuff here
end
end
다음 호출 코드는
foo = Foo.new
foo.run(:running, [param1, param2])
이 예제를 따라하는 것 같다,하지만 난 그게 동작하지 않습니다 :
코드는 다음과 같습니다. 어떤 도움을 주시면 감사하겠습니다.
전체 오류 스택 추적을보고 오류가 발생한 행 번호를 확인해야합니다 – dnsh