Displaying 1 result from an estimated 1 matches for "delete_material".
2006 Aug 16
1
update entry in a has_many relation
...rial.size = @params["material_size"]
person.update
end
def add
person = Person.new
person.name = @params["name"]
material = person.materials.find(@params["material_id"])
person.materials.push(material)
person.update
end
def delete_material
person = Person.find(@params["id"])
person.name = @params["name"]
material = person.materials.find(@params["material_id"])
person.materials.delete(material)
person.update
end
end
Thanks,
H
--
Posted via http://www.ruby-forum.com/.