search for: parts_to_update

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

2006 Oct 03
0
WebObjects-style Object Cache
...a form for editing a Page and all of it''s parts and when you submit the form all of your changes are saved. There''s an action that handles the post that saves the page and all the parts. def handle_post if request.post? @page.attributes = params[:page] parts_to_update = [] (params[:part] || {}).values.each do |v| if part = @page.parts.find_by_name(v[:name]) part.attributes = part.attributes.merge(v) parts_to_update << part else @page.parts.build(v) end end if @page.sa...