Module: Sinatra::UserAgentHelpers
- Defined in:
- lib/sinatra/support/useragenthelpers.rb
Overview
Usage
register Sinatra::UserAgentHelpers
Example
After you have registered the UserAgentHelpers, use the #browser helper to check for features:
<% if browser.ios? %>
<p>Download our mobile app!</p>
<% end %>
Or use the #body_class method:
The above line can have an output like so:
Helper
#browser -- provides the browser helper. Refer to the {UserAgent} class
for more info.