Guest User

Untitled

a guest
May 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class ResponsesController < ApplicationController
  2.  
  3. rescue_from Question::NoRandomQuestionsLeft, :with => :no_more_questions
  4.  
  5. def new
  6. @question = current_question_distributor.current_question(true, :include => :answers)
  7. end
  8.  
  9. private
  10.  
  11. def no_more_questions
  12. flash[:warning] = "You have answered all the questions. Please check back again."
  13. respond_to do |format|
  14. format.html { redirect_to ask_path }
  15. format.xml {}
  16. end
  17. end
  18. end
Add Comment
Please, Sign In to add comment