app/controllers/sections_controller.rb
def update_section_nested_items
    snis = params[:section][:linked_items]
    updated_snis = []
    updated_snis = @section.update_snis(snis) if snis
    updated_snis
  end
# !!! this algorithm assumes a question cannot appear twice on the same section !!!
# Only update section questions that were changed
this algorithm assumes a question cannot appear twice on the same section
Only update section questions that were changed
this algorithm assumes a question cannot appear twice on the same section Only update section questions that were changed
def update_section_nested_items
    snis = params[:section][:linked_items]
    updated_snis = []
    updated_snis = @section.update_snis(snis) if snis
    updated_snis
  end
def update_section_nested_items snis = params [ :section ] [ :linked_items ] updated_snis = [ ] updated_snis = @section . update_snis ( snis ) if snis updated_snis end
this algorithm assumes a question cannot appear twice on the same section !
this algorithm assumes a question cannot appear twice on the same section !