search for: contentcompon

Displaying 1 result from an estimated 1 matches for "contentcompon".

2006 Jul 31
1
Use of push_with_attributes
...eating 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...