Skip to content

Instantly share code, notes, and snippets.

@barek2k2
Created June 29, 2014 16:18
Show Gist options
  • Save barek2k2/c4d9326dbf37850f322d to your computer and use it in GitHub Desktop.
Save barek2k2/c4d9326dbf37850f322d to your computer and use it in GitHub Desktop.
questions controller
class QuestionsController < ApplicationController
def show
@question = Question.find(params[:id])
end
def next
question = Question.find(params[:question_id])
next_question = question.next_question_for(params[:answer])
redirect_to question_url(next_question)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment