From b5190d8df22c96097ffe3968140de561c69a8d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 29 Apr 2011 14:11:47 +0200 Subject: [PATCH] Refactor. --- lib/devise/failure_app.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/devise/failure_app.rb b/lib/devise/failure_app.rb index 74700d71..b98cfecc 100644 --- a/lib/devise/failure_app.rb +++ b/lib/devise/failure_app.rb @@ -65,15 +65,17 @@ module Devise end def redirect_url - if [:html, :"*/*", "*/*"].include? request_format - #if is_navigational_format? - #if request_format == :html + if skip_format? send(:"new_#{scope}_session_path") else send(:"new_#{scope}_session_path", :format => request_format) end end + def skip_format? + %w(html */*).include? request_format.to_s + end + # Choose whether we should respond in a http authentication fashion, # including 401 and optional headers. #