Sha256: 3f522349c37cf41eae3a1f574bb5024cee1e8b0ec67b6a83a60668f16cf110d6
Contents?: true
Size: 723 Bytes
Versions: 5
Compression:
Stored size: 723 Bytes
Contents
class SurveyorGui::SurveyController < ApplicationController def show @title = "User Will See this Survey" @survey = Survey.find(params[:survey_id]) user_id = defined?(current_user) && current_user ? current_user.id : 1 ResponseSet.where('survey_id = ? and test_data = ? and user_id = ?',params[:survey_id],true, user_id).each {|r| r.destroy} @response_set = ResponseSet.create(:survey => @survey, :user_id => user_id, :test_data => true) if (@survey) flash[:notice] = t('surveyor.survey_started_success') redirect_to surveyor.edit_my_survey_path @survey.access_code, @response_set.access_code else flash[:notice] = "Survey not found." redirect :back end end end
Version data entries
5 entries across 5 versions & 2 rubygems