Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed May 16, 2011
1 parent ce66d5c commit 7a35e23
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.rdoc
Expand Up @@ -24,6 +24,9 @@ html5_validators is a gem/plugin for Rails 3 that enables client-side validation
HTML:
<input id="user_name" name="user[name]" required="required" type="text" />

SCREENSHOT:
http://img.skitch.com/20110516-1kmy7fcuwkq84xihki2udkgh3a.jpg

SPEC:
http://dev.w3.org/html5/spec/Overview.html#attr-input-required

Expand All @@ -32,14 +35,14 @@ html5_validators is a gem/plugin for Rails 3 that enables client-side validation
Model:
class User
include ActiveModel::Validations
validates_length_of :name, :maximum => 5
validates_length_of :name, :maximum => 10
end

View:
<%= f.text_field :name %>

HTML:
<input id="user_name" maxlength="5" name="user[name]" size="5" type="text" />
<input id="user_name" maxlength="10" name="user[name]" size="10" type="text" />

SPEC:
http://dev.w3.org/html5/spec/Overview.html#attr-input-maxlength
Expand All @@ -58,6 +61,9 @@ html5_validators is a gem/plugin for Rails 3 that enables client-side validation
HTML:
<input id="user_age" min="20" name="user[age]" size="30" type="number" />

SCREENSHOT:
http://http://img.skitch.com/20110516-n3jhu5m4gan8iy1j8er1qb7yfa.jpg

SPEC:
http://dev.w3.org/html5/spec/Overview.html#attr-input-max
http://dev.w3.org/html5/spec/Overview.html#attr-input-min
Expand Down

0 comments on commit 7a35e23

Please sign in to comment.