Permalink
Browse files

Merge pull request #16 from gareth/master

force_mobile_format
  • Loading branch information...
2 parents 80b42e7 + 2a4be46 commit cfd29fbd7dd6ac1155dcb33707fe00961af60e93 @brendanlim committed Aug 8, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/mobile_fu.rb
View
@@ -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 cfd29fb

Please sign in to comment.