From 4b84c458eced3e52cd1ea310d69e1d8368ae7a86 Mon Sep 17 00:00:00 2001 From: Roland Venesz Date: Wed, 4 Jul 2012 17:16:03 +0200 Subject: [PATCH] Only force HTML requests --- lib/mobile_fu.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mobile_fu.rb b/lib/mobile_fu.rb index 70c6163..a059206 100644 --- a/lib/mobile_fu.rb +++ b/lib/mobile_fu.rb @@ -69,7 +69,7 @@ def force_mobile_format # the user has opted to use either the 'Standard' view or 'Mobile' view. def set_mobile_format - if is_mobile_device? && !request.xhr? + if request.format.html? && is_mobile_device? && !request.xhr? request.format = session[:mobile_view] == false ? :html : :mobile session[:mobile_view] = true if session[:mobile_view].nil? end