有什麼真的很容易方式來了解,什麼瀏覽器稱爲控制器的行動。簡單的方法來檢查瀏覽器的名稱和版本
我想有一個代碼,我的控制器,就像這樣:
if mighty_lib.browser.name == "Safari"
if mighty_lib.browser.version >= 5
# Glad to see you, Safari 5, there is a stunning, interactive page for you.
elsif mighty_lib.browser.version >= 4
# Glad to see you, Safari 4, there is a less advanced page for you.
end
if mighty_lib.browser.name == "Firefox"
# Quick brown fox jumps over the lazy dog
elsif mighty_lib.browser.name == "IE"
# Oh, my god ... Change your browser ! There is a "Jurassic Park" movie for you
end