Displaying 1 result from an estimated 1 matches for "add_content_entry".
2006 Apr 20
4
ActiveRecord: Many-to-Many problem
...lationship on classes Section and
Content.
Both Content and Section has:
has_and_belongs_to_many :contents and has_and_belongs_to_many :sections
and I have an exception when trying to access model properties:
"undefined method `add_contents'' for #<Section:0xb745c514>"
def add_content_entry
@section = Section.find(params[:section_id])
@content = Content.find(params[:content_id])
@section.add_contents(@content)
@section.name = ''test''
@section.update
redirect_to :action => ''list''
end
Where I am wrong?