@params = params
end
end
Instead do this:
my_object = MyClass.new(:params => params)
my_object.save
Or this:
MyClass.create :params => params
The above will automatically save the record to the DB.
class MyClass < ActiveRecord::Base
def initialize(params)
@params = params
end
end
my_object = MyClass.new(:params => params)
my_object.save
MyClass.create :params => params
No comments:
Post a Comment