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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9ed2e1e228e7d385654b5d4d2dd4f7b4a893a36
4
- data.tar.gz: 2d8ac4015bd996461c079d22a567b1c9a74c4345
3
+ metadata.gz: a9f23f767b07302a1f573131d99c86f1bd6a822a
4
+ data.tar.gz: 1cba1523a721cb5341a13b148ff46f6f6613ad18
5
5
  SHA512:
6
- metadata.gz: b680c10b0f28c3482fadc8fcaf4ba6e0ff666c8e5329eab58a1b10a208f9186e6805a625b049ea8cde42c58c049ab91ce8ecdd07644b613c8e41ddd610d5a748
7
- data.tar.gz: 11db1ddb6f443e052e91aa2dc341d753e33a57e9e288ca06162261772fdb6e478e64ecbc78655e1856fcc4c8708e748af2691f0ac936b2f6358fdc575de551b3
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
- content_tag :div, class: "row" do
10
- content_tag :div, class: "col-md-12 well" do
11
- nested_form_for(object, options, &block)
12
- end
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.alpha3
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-11 00:00:00.000000000 Z
13
+ date: 2013-11-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: phantom_forms