私はこれを解決できないようです。
私はデータベースなしでこれを達成したい:
Object.new(:attribute_1 => "foobar", :attribute_2 => "foobar")
これを返します:
ArgumentError: wrong number of arguments (1 for 0)
from (irb):5:in `initialize'
from (irb):5:in `new'
from (irb):5
私のモデル:
class Object
extend ActiveModel::Naming
include ActiveModel::Conversion
def persisted?
false
end
attr_accessor :attribute_1, :attribute_2