Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Provides Rails helper methods wrapping the HTTP headers set by Rack::Html5.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
rake
test
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
rack-html5-rails_helper.gemspec

README.rdoc

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.

A demo is available here: html5-test.heroku.com

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
Something went wrong with that request. Please try again.