jquery-validator 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +2 -2
- data/VERSION +1 -1
- data/jquery-validator.gemspec +1 -1
- data/lib/jquery_validator/form_builder.rb +1 -3
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -38,9 +38,9 @@ Supported validations include:
|
|
38
38
|
|
39
39
|
== Options
|
40
40
|
|
41
|
-
You can pass a :
|
41
|
+
You can pass a :only argument to jquery_validations to only validate certain fields. All other options are converted to JSON and passed directly to the jquery validate() method. You can pass javascript functions as strings. For example
|
42
42
|
|
43
|
-
<%= f.jquery_validators :
|
43
|
+
<%= f.jquery_validators :only => [:login, :email], :debug => true, :submitHandler => "function() { alert('Thank you!'); }" %>
|
44
44
|
|
45
45
|
If you want to be more unobtrusive, add
|
46
46
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/jquery-validator.gemspec
CHANGED
@@ -2,11 +2,9 @@ module ActionView
|
|
2
2
|
module Helpers
|
3
3
|
class FormBuilder
|
4
4
|
def jquery_validators(options = {})
|
5
|
-
fields = options.delete(:
|
5
|
+
fields = options.delete(:only)
|
6
6
|
|
7
|
-
Rails.logger.debug @object.class.validators.map(&:attributes)
|
8
7
|
@object.class.validators.each do |v|
|
9
|
-
Rails.logger.debug "doing validator #{v}"
|
10
8
|
if !fields || fields.include?(v.attributes.first)
|
11
9
|
if validator = JqueryValidator.factory(v, self)
|
12
10
|
options.deep_merge!(JqueryValidator.factory(v, self).validate_arguments)
|