angular_form_validation 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42608d1d5b36413c586e199b552367d40f1b7227
|
4
|
+
data.tar.gz: db2040a061ea53a325ce077b2fd6ef19f4c10606
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e765c3052e46540cc07a7af55e462ef3f37aec7d3b909d6bd4db66bbe9e2cc5facc2f46add4857099b843337c9d6ccfaa41f8106c3a6ddb91fbe035214015079
|
7
|
+
data.tar.gz: e04b8e7e7d7176d3f0cbafa89a2a805260bd4c6ff915a7a4d1a649e152e85eb5eac4175f6c23da28004d549c20ef33b7b5105a2d213d686d8213f08921dbc7bf
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ This helper can be used on form inputs to add the ng-model and ng-init attribute
|
|
46
46
|
|
47
47
|
Example:
|
48
48
|
|
49
|
-
<%= text_field_tag :name, params[:name],
|
49
|
+
<%= text_field_tag :name, params[:name], ng_model_opts(@user, :name, required: true) %>
|
50
50
|
|
51
51
|
### ng_submit_opts(object)
|
52
52
|
|
@@ -54,7 +54,7 @@ This helper can be used on form buttons to add the ng-disabled attribute:
|
|
54
54
|
|
55
55
|
Example:
|
56
56
|
|
57
|
-
<%= button_tag t("common.form.actions.save_btn"), ng_submit_opts(@product_config)
|
57
|
+
<%= button_tag t("common.form.actions.save_btn"), ng_submit_opts(@product_config) %>
|
58
58
|
|
59
59
|
### Example
|
60
60
|
|
@@ -65,3 +65,5 @@ Example:
|
|
65
65
|
text_field_tag :name, params[:name], { required: true }.merge(ng_model_opts(@product_category, :name)
|
66
66
|
button_tag "Create", ng_submit_opts(@product_category)
|
67
67
|
end
|
68
|
+
|
69
|
+
Developed by [Nimbl3](www.nimbl3.com)
|
Binary file
|
@@ -10,12 +10,13 @@ module AngularFormValidation
|
|
10
10
|
super(url_for_options, options, &block)
|
11
11
|
end
|
12
12
|
|
13
|
-
def ng_model_opts(object, attribute)
|
13
|
+
def ng_model_opts(object, attribute, options = {})
|
14
14
|
object_name = object.class.model_name.singular
|
15
15
|
init_value = params[object_name.to_sym][attribute.to_s] if params[object_name.to_sym].present?
|
16
16
|
opts = {}
|
17
17
|
opts["ng-model"] = "#{object_name}.#{attribute.to_s}"
|
18
18
|
opts["ng-init"] = "#{object_name}.#{attribute.to_s}='#{init_value}'"
|
19
|
+
opts.merge!(options)
|
19
20
|
opts
|
20
21
|
end
|
21
22
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular_form_validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Robert
|
@@ -51,7 +51,7 @@ files:
|
|
51
51
|
- LICENSE.txt
|
52
52
|
- README.md
|
53
53
|
- Rakefile
|
54
|
-
- angular_form_validation-0.1.
|
54
|
+
- angular_form_validation-0.1.7.gem
|
55
55
|
- angular_form_validation.gemspec
|
56
56
|
- lib/angular_form_validation.rb
|
57
57
|
- lib/angular_form_validation/form/builder.rb
|
Binary file
|