app/controllers/questionnaires_controller.rb
def toggle_access
    @questionnaire = Questionnaire.find(params[:id])
    @questionnaire.private = !@questionnaire.private
    @questionnaire.save
    @access = @questionnaire.private == true ? "private" : "public"
    undo_link("the questionnaire \"#{@questionnaire.name}\" has been successfully made #{@access}. ")
    redirect_to controller: 'tree_display', action: 'list'
  end
# Toggle the access permission for this assignment from public to private, or vice versa
Toggle the access permission for this assignment from public to private, or vice versa
Toggle the access permission for this assignment from public to private or vice versa
def toggle_access
    @questionnaire = Questionnaire.find(params[:id])
    @questionnaire.private = !@questionnaire.private
    @questionnaire.save
    @access = @questionnaire.private == true ? "private" : "public"
    undo_link("the questionnaire \"#{@questionnaire.name}\" has been successfully made #{@access}. ")
    redirect_to controller: 'tree_display', action: 'list'
  end
def toggle_access @questionnaire = Questionnaire . find ( params [ :id ] ) @questionnaire . private = ! @questionnaire . private @questionnaire . save @access = @questionnaire . private == true ? "private" : "public" undo_link ( "the questionnaire \"#{@questionnaire.name}\" has been successfully made #{@access}. " ) redirect_to controller : 'tree_display' , action : 'list' end
Toggle the access permission for this assignment from public to private, or vice versa
Toggle the access permission for this assignment from public to private or vice versa