phantom_nested_forms 0.2.0.alpha3 → 0.2.0.alpha4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phantom_nested_forms/helper.rb +24 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9f23f767b07302a1f573131d99c86f1bd6a822a
|
4
|
+
data.tar.gz: 1cba1523a721cb5341a13b148ff46f6f6613ad18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c78f3dea0523d58478452c5f9dc0abc276127a3022803a0dba08a6f92d65f19a1a9289a2f2219db18c30409b775dd3c9d20a0bb21434c8377e354c0da7e4c1b
|
7
|
+
data.tar.gz: a0f57741e147685e288e9cca5a65a38c52f31fa2053c1a0fa16da888990898a790dbdfe0ce381f30e2ef01dec39e9109564f541b4893b1fd1ad335b8504dd182
|
@@ -6,10 +6,14 @@ module PhantomNestedForms
|
|
6
6
|
options[:builder] = PhantomNestedForms::FormBuilders::ValidateNestedFormBuilder
|
7
7
|
options[:html] = {:class => 'remote-form form'}
|
8
8
|
options[:remote] = true
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
|
10
|
+
object_name = get_class(extract_object(object))
|
11
|
+
object_class = options[:resource] || object_name
|
12
|
+
label = options[:label] || t("#{object_name.underscore}.singular")
|
13
|
+
|
14
|
+
content_tag :div, class: "panel panel-primary" do
|
15
|
+
concat(panel_title(label, slide_form_close_button(object_class))) unless label == 'nil'
|
16
|
+
concat(content_tag(:div, class: "panel-body") { nested_form_for(object, options, &block) })
|
13
17
|
end
|
14
18
|
end
|
15
19
|
|
@@ -31,5 +35,21 @@ module PhantomNestedForms
|
|
31
35
|
end
|
32
36
|
end
|
33
37
|
|
38
|
+
|
39
|
+
def normal_nested_form_for(object, options = {}, &block)
|
40
|
+
options[:validate] = true
|
41
|
+
options[:builder] = PhantomNestedForms::FormBuilders::ValidateNestedFormBuilder
|
42
|
+
options[:html] = {:class => 'normal-form form'}
|
43
|
+
|
44
|
+
object_name = get_class(extract_object(object))
|
45
|
+
object_class = options[:resource] || object_name
|
46
|
+
label = options[:label] || t("#{object_name.underscore}.singular")
|
47
|
+
|
48
|
+
content_tag :div, class: "panel panel-primary" do
|
49
|
+
concat(panel_title(label, slide_form_close_button(object_class))) unless label == 'nil'
|
50
|
+
concat(content_tag(:div, class: "panel-body") { nested_form_for(object, options, &block) })
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
34
54
|
end
|
35
55
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phantom_nested_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.alpha4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vassil Kalkov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-11-
|
13
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: phantom_forms
|