app/controllers/questionnaires_controller.rb
#Sets the status of a questionnaire to close. This prevents respondents
#from being able to access the questionnaire's submission page
Sets the status of a questionnaire to close. This prevents respondents
from being able to access the questionnaire's submission page
Sets the status of a questionnaire to close . This prevents respondents from being able to access the questionnaire ' s submission page
def close
    @result = @questionnaire.close!
    if @result
      flash[:notice] = "Questionnaire successfully closed!"
    else
      flash[:error] = "Errors when closing questionnaire. You can only close a questionnaire that is active."
    end
    respond_to do |format|
      format.html { redirect_to(dashboard_questionnaire_path(@questionnaire)) }
      format.js
    end
  end
def close @result = @questionnaire . close! if @result flash [ :notice ] = "Questionnaire successfully closed!" else flash [ :error ] = "Errors when closing questionnaire. You can only close a questionnaire that is active." end respond_to do | format | format . html { redirect_to ( dashboard_questionnaire_path ( @questionnaire ) ) } format . js end end
Sets the status of a questionnaire to close.
Sets the status of a questionnaire to close .