class QuestionsController < ApplicationController include QuizHelperMethods def show not_found unless question @answer = Answer.new(player_id: current_player.id, node_id: question.id) end def answer @answer = Answer.find_by(node_id: question.id, player_id: current_player.id) @question_answer = question.attachments.with_text.each_slice(2).to_a[@answer.value] end end