def update
      @page = Page.find(params[:id])
      questions = @presenter.all_questions_for_page(params[:id])
      questions.post(params[:answers], @answer_sheet)
      
      questions.save
      
      @elements = questions.elements
      
      # Save references
      if params[:reference].present?
        params[:reference].each do |id, values|
          ref = @answer_sheet.reference_sheets.find(id)
          # if the email address has changed, we have to trash the old reference answers
          ref.attributes = values
          ref.save(:validate => false)
        end
      end
      @presenter.active_page = nil
      @answer_sheet.touch
      respond_to do |format|
        format.js
        #format.html
      end
    end
def update
      @page = Page.find(params[:id])
      questions = @presenter.all_questions_for_page(params[:id])
      questions.post(params[:answers], @answer_sheet)
      
      questions.save
      
      @elements = questions.elements
      
      # Save references
      if params[:reference].present?
        params[:reference].each do |id, values|
          ref = @answer_sheet.reference_sheets.find(id)
          # if the email address has changed, we have to trash the old reference answers
          ref.attributes = values
          ref.save(:validate => false)
        end
      end
      @presenter.active_page = nil
      @answer_sheet.touch
      respond_to do |format|
        format.js
        #format.html
      end
    end
validate and save captured data for a given page
 PUT /answer_sheets/1/pages/1