force_mobile_format #16

Merged
merged 1 commit into from Aug 8, 2011
Jump to file
+4 −2
Split
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