rails_ajax_formhandler 0.1.4 → 0.1.5
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc8f4c1b0d9afa23b669fc7e50691268c99ea069
|
4
|
+
data.tar.gz: 6106a48ae9a01bec97f8f2ad5bdb1ce8e044b270
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1f64693530cc07e7c48e880bc21d137da3ac0358e5edecc31c86bb5dcc1db8eaedac80b42299ec5edb22d6baf6cbbb44782d381c73a26eeb58d81414ad1c502
|
7
|
+
data.tar.gz: cd88da818c40ad006d47416383ffb8305082056989b1751bfcd7d5b9241305ec43edd631d317b4b2b24769b855b1f5f28ab29a820d58d3b738735faae31107a1
|
@@ -234,7 +234,7 @@ PLEASE NOTE THAT VALIDATION-RENDERING NOT WORKING WITH NESTED ATTRIBUTES, AT LEA
|
|
234
234
|
$.each($('form'),function(index,form) {
|
235
235
|
if(form.id) {
|
236
236
|
var form_name = form_handler.filter_form_name(form.id);
|
237
|
-
var form_object = { id: form.id, ignore: false,
|
237
|
+
var form_object = { id: form.id, ignore: false, name: form_name};
|
238
238
|
$.extend(true,form_object,global_defaults);
|
239
239
|
form_objects[form_name] = form_object;
|
240
240
|
}
|
@@ -352,7 +352,7 @@ var FormObject = function(form_id, options) {
|
|
352
352
|
this.callbacks.on_error = options.error || function() {};
|
353
353
|
this.form_id = form_id;
|
354
354
|
this.form = $("#" + form_id);
|
355
|
-
this.form_object_name =
|
355
|
+
this.form_object_name = options.name;
|
356
356
|
this.method = "POST";
|
357
357
|
this.set_form_type();
|
358
358
|
this.html_options = options.html;
|
@@ -367,7 +367,7 @@ FormObject.prototype.set_form_type = function() {
|
|
367
367
|
if(form.find("input[name='_method']").length > 0) {
|
368
368
|
this.method = form.find("input[name='_method']").first().val();
|
369
369
|
}
|
370
|
-
|
370
|
+
|
371
371
|
};
|
372
372
|
|
373
373
|
|
@@ -460,6 +460,7 @@ FormObject.prototype.get_ajax_settings = function(event,values) {
|
|
460
460
|
|
461
461
|
FormObject.prototype.error = function(response_object) {
|
462
462
|
var errors;
|
463
|
+
console.log(response_object);
|
463
464
|
response_object[this.form_object] === undefined ? errors = response_object : errors = response_object[this.form_object]
|
464
465
|
this.validation_renderer.render(this.fields(),errors);
|
465
466
|
|
@@ -468,7 +469,6 @@ FormObject.prototype.get_ajax_settings = function(event,values) {
|
|
468
469
|
FormObject.prototype.success = function() {
|
469
470
|
var form_object = this;
|
470
471
|
var fields = this.fields();
|
471
|
-
console.log(fields);
|
472
472
|
$.each(fields,function(key,value) {
|
473
473
|
var field = $("#" + value);
|
474
474
|
form_object.validation_renderer.remove_error(field);
|