app/controllers/questionnaires_controller.rb
#Changes the status of a questionnaire to open so that it is available
#for respondents to fill in answers
Changes the status of a questionnaire to open so that it is available
for respondents to fill in answers
Changes the status of a questionnaire to open so that it is available for respondents to fill in answers
def open
    @result = @questionnaire.open!
    if @result
      flash[:notice] = "Questionnaire successfully opened."
    else
      flash[:error] = "Errors when closing questionnaire. You can only open a questionnaire that is closed."
    end
    respond_to do |format|
      format.html { redirect_to(dashboard_questionnaire_path(@questionnaire)) }
      format.js
    end
  end
def open @result = @questionnaire . open! if @result flash [ :notice ] = "Questionnaire successfully opened." else flash [ :error ] = "Errors when closing questionnaire. You can only open a questionnaire that is closed." end respond_to do | format | format . html { redirect_to ( dashboard_questionnaire_path ( @questionnaire ) ) } format . js end end
Changes the status of a questionnaire to open so that it is available
for respondents to fill in answers
Changes the status of a questionnaire to open so that it is available for respondents to fill in answers