rack-html5-rails_helper

Rack::Html5 adds a HTTP header for each HTML5 feature the browser supports. This code provides convenient rails helper methods wrapping those headers.

Usage

Provides the following methods you can use in controllers and views:

  • browser_supports_wysiwyg?

  • browser_supports_classname?

  • browser_supports_elements?

  • browser_supports_canvas?

  • browser_supports_messaging?

  • browser_supports_audio?

  • browser_supports_video?

  • browser_supports_textapi?

  • browser_supports_draganddrop?

  • browser_supports_offline?

  • browser_supports_svg?

  • browser_supports_forms?

Installation

gem install rack-html5
gem install rack-html5-rails_helper

Configuration for Rails 2

Add the following lines to the config block in your environment.rb file:

config.gem "rack-html5"
config.middleware.use "Rack::Html5"

Include module in ApplicationController:

include RackHtml5RailsHelper

Configuration for Rails 3

Add the gem dependency to Gemfile:

gem 'rack-html5'

Install the gem with bundler:

sudo bundler install

Add the Rack middleware to config.ru:

use Rack::Html5

Include module in ApplicationController:

include RackHtml5RailsHelper