With most modern browsers beginning to include support for HTML5, developers are looking for ways to make it easy to take advantage of the news tags in their current web frameworks.
Jesse Dearing recently published a set of Rails helpers that make it painless to begin using the new elements in the context of a Rails application.
HTML5Helpers is a Rails plugin that brings a set of HTML5 tags to the Rails framework. The following tags are currently supported:
- Search
- Telephone
- Number
- Range
- URL
Once installed, you can use the tags as you would with any of the other Rails helpers:
[cc lang=”html”]
<%= search_field_tag :search, "Search something..." %>
<%= telephone_field_tag :phone, "123-456-7890" %>
<%= number_field_tag :number, 5, :step => 1, :min => 0, :max => 10 %>
<%= range_field_tag :range, 5, :min => 0, :max => 10 %>
<%= email_field_tag :email, "[email protected]" %>
<%= url_field_tag :url, "http://github.com" %>
[/cc]
You can follow Jesse’s development, download the helpers, or to read the documentation in the GitHub Repository.
Speak your mind...