gaku_nested_forms 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ //= require nested_forms
@@ -0,0 +1,23 @@
1
+ formBuilder =
2
+ add: (element, settings, message) ->
3
+ if element.data("valid") isnt false
4
+ element.data "valid", false
5
+ element.parent().parent().addClass "error"
6
+ element.parent().find(".message").addClass "error help-inline"
7
+ $('<span/>').addClass('help-inline').text(message).appendTo(element.parent())
8
+
9
+ remove: (element, settings) ->
10
+ element.parent().parent().removeClass('error')
11
+ element.parent().find(".message").removeClass "error help-inline"
12
+ element.parent().find('span.help-inline').remove()
13
+ element.data "valid", true
14
+
15
+ window.ClientSideValidations.formBuilders["GakuNestedForms::FormBuilders::ValidateNestedFormBuilder"] = formBuilder
16
+
17
+ $ ->
18
+
19
+ window.ClientSideValidations.callbacks.element.fail = (element, message, callback) ->
20
+ callback()
21
+ if element.data("valid") isnt false
22
+ element.parent().parent().addClass "error"
23
+ element.parent().find(".message").addClass "error help-inline"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaku_nested_forms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Vassil Kalkov
@@ -72,6 +72,8 @@ files:
72
72
  - lib/gaku_nested_forms/engine.rb
73
73
  - lib/gaku_nested_forms/helper.rb
74
74
  - lib/gaku_nested_forms/form_builders/validate_nested_form_builder.rb
75
+ - vendor/assets/javascripts/nested_forms.js.coffee
76
+ - vendor/assets/javascripts/gaku_nested_forms.js
75
77
  - README.md
76
78
  homepage: http://kalkov.github.io
77
79
  licenses: []