This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Wed Apr 09 13:55:55 -0700 2008 | [jcoglan] |
| |
README | Fri Apr 11 06:48:23 -0700 2008 | [jcoglan] |
| |
Rakefile | Fri Apr 11 03:36:28 -0700 2008 | [jcoglan] |
| |
init.rb | Thu Apr 10 06:27:26 -0700 2008 | [jcoglan] |
| |
install.rb | Fri Apr 11 03:54:48 -0700 2008 | [jcoglan] |
| |
javascripts/ | Tue Jul 15 02:02:08 -0700 2008 | [jcoglan] |
| |
lib/ | Mon Sep 01 05:00:31 -0700 2008 | [jcoglan] |
| |
tasks/ | Wed Apr 09 13:55:55 -0700 2008 | [jcoglan] |
| |
test/ | Tue Jul 15 02:02:08 -0700 2008 | [jcoglan] |
| |
uninstall.rb | Wed Apr 09 13:55:55 -0700 2008 | [jcoglan] |
README
== Acceptance Copyright (c) 2008 James Coglan, released under the MIT license Acceptance is a port of the Ojay.Forms validation API to work with the Prototype library. This plugin provides hooks into your Rails application that can automatically generate client-side validation code from your Rails models. Information on the client-side API can be found at the Ojay project site: http://ojay.othermedia.org/articles/forms.html The only difference here is that you need to call <tt>Acceptance()</tt> instead of <tt>Ojay.Forms()</tt> when using the API. All the other function calls are identical. For example: Acceptance(function() { with(this) { form('the-form') .requires('username').toHaveLength({minimum: 6}) .expects('email_confirmation').toConfirm('email'); }}); Refer to the Ojay site for the rest of the API. You can use this plugin with the original Ojay client-side library by putting this in your environment.rb: Acceptance.adapter = :ojay To have Acceptance generate client-side code for you, simply replace any calls to +form_for+ with +acceptance_form_for+. A script tag will be added after the form containing rules for any fields in the form that can be checked client-side without making a server request. # Before <% form_for(@user) do |f| %> ... <% end %> # After <% acceptance_form_for(@user) do |f| %> ... <% end %> The following validation types are supported, with a few limitations: validates_acceptance_of validates_confirmation_of validates_exclusion_of validates_format_of validates_inclusion_of validates_length_of validates_numericality_of validates_presence_of validates_size_of





