mobile-fu 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mobile-fu.rb +6 -5
- data/lib/mobile-fu/version.rb +1 -1
- metadata +2 -2
data/lib/mobile-fu.rb
CHANGED
@@ -28,18 +28,18 @@ module ActionController
|
|
28
28
|
# has_mobile_fu
|
29
29
|
# end
|
30
30
|
#
|
31
|
-
# If you don't want mobile_fu to set the
|
32
|
-
# you
|
31
|
+
# If you don't want mobile_fu to set the request format automatically,
|
32
|
+
# you can pass false here.
|
33
33
|
#
|
34
34
|
# class ApplicationController < ActionController::Base
|
35
35
|
# has_mobile_fu false
|
36
36
|
# end
|
37
37
|
#
|
38
38
|
|
39
|
-
def has_mobile_fu(
|
39
|
+
def has_mobile_fu(set_request_format = true)
|
40
40
|
include ActionController::MobileFu::InstanceMethods
|
41
41
|
|
42
|
-
before_filter :
|
42
|
+
before_filter :set_request_format if set_request_format
|
43
43
|
|
44
44
|
helper_method :is_mobile_device?
|
45
45
|
helper_method :in_mobile_view?
|
@@ -49,9 +49,10 @@ module ActionController
|
|
49
49
|
end
|
50
50
|
|
51
51
|
module InstanceMethods
|
52
|
-
def
|
52
|
+
def set_request_format(force_mobile = false)
|
53
53
|
force_mobile ? force_mobile_format : set_mobile_format
|
54
54
|
end
|
55
|
+
alias :set_device_type :set_request_format
|
55
56
|
|
56
57
|
# Forces the request format to be :mobile
|
57
58
|
def force_mobile_format
|
data/lib/mobile-fu/version.rb
CHANGED