このエラーがあります
ArgumentError (wrong number of arguments (1 for 0)):
lib/law/production.rb:20:in `clone'
lib/law/production.rb:20:in `clone_law'
lib/law/production.rb:11:in `initialize'
app/controllers/laws_controller.rb:86:in `new'
app/controllers/laws_controller.rb:86:in `prod_law'
app/controllers/laws_controller.rb:44:in `create'
これを使うとき
module Law
class Production
attr_accessor :law
attr_accessor :creator
def initialize(law,current_user)
@law = law
@creator = current_user
clone_law
end
def current__user
User.find_by_authentication_token(session[:_csrf_token])
end
def clone_law
clone(@law)
end
end
end
どこclone
でcreate
、、、prod_law
私が想定していると思われるいくつかのメソッドがありますRails
が、hash
その理由はわかりません