Detects user’s browser.
Can be used in the layer view and the layer controller.
Provides two methods:
- browser_name
- browser_is?
The method browser_is? accepts the symbols:
- :firefox
- :opera
- :chrome
- :safari
- :ie
./script/plugin install git://github.com/patrickespake/pake_browser_detect.git
In the layer view:
<%= browser_name %>
<%= browser_is? :firefox %>
In the layer controller:
browser_name
browser_is? :firefox
http://lab.patrickespake.com/pake_browser_detect
Copyright © 2009 Patrick Espake, released under the MIT license
Site: http://www.patrickespake.com
Blog: http://blog.patrickespake.com
Email: patrickespake@gmail.com