Skip to content
Browse files

Don't force format for XHR requests

  • Loading branch information...
1 parent 80b42e7 commit 2a4be46a8dfd0cf7b33039df2dba59c21d21c380 Gareth Adams committed Jan 19, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/mobile_fu.rb
View
6 lib/mobile_fu.rb
@@ -59,8 +59,10 @@ module InstanceMethods
# Forces the request format to be :mobile
def force_mobile_format
- request.format = :mobile
- session[:mobile_view] = true if session[:mobile_view].nil?
+ if !request.xhr?
+ request.format = :mobile
+ session[:mobile_view] = true if session[:mobile_view].nil?
+ end
end
# Determines the request format based on whether the device is mobile or if

0 comments on commit 2a4be46

Please sign in to comment.
Something went wrong with that request. Please try again.