Hi,
I have a model class called Page and a corresponding pages table in the
db.
Is there a way to do Page.new without actually creating a corresponding
record in the table? I want to set some values in it and then pass it to
the add_content_component() method in the class below which calls
push_with_attributes() which will actually create the record in the db?
class Page < ActiveRecord::Base
has_and_belongs_to_many :contentcomponents
...
def add_content_component(content_component)
pos = Integer(contentcomponents.size) + 1
contentcomponents.push_with_attributes(content_component, :pos =>
pos)
end
...
end
Or am I all messed up and I should be taking a different approach?
Thanks!
Paul
--
Posted via http://www.ruby-forum.com/.