Created
June 29, 2014 16:18
-
-
Save barek2k2/c4d9326dbf37850f322d to your computer and use it in GitHub Desktop.
questions controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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