# frozen_string_literal: true # This file was generated by QuestionsCrafter # Generated at: <%= Time.now.strftime("%Y-%m-%d %H:%M:%S") %> class <%= class_name.camelize %>Controller < ApplicationController include QuestionsCrafter::ControllerHelpers handles_questions <%= class_name %>Questions, on_success: :create_handler def create_handler(questions_object) # Bussiness layer logic that can now access the fields defined in the SurveyQuestions instance # if questions_object.age > 40 # If no redirect is detected it will just display the answers redirect_to root_path end end