phantom_forms 0.2.0.alpha4 → 0.2.0.alpha5
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: d3c60eead7eac9cca67438ea6624493112a2ddd0
|
4
|
+
data.tar.gz: c2def94d82602f6031d228c0b68ba9a3e3bbf30e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e73b472ab10d09a55b5b958c6f496100c5d84c403a398e7e65d0d62a0ad577d0cfadde559d9398ebbb78c763f70ed21b9fcff6c941848b29e07685e3f2403dc
|
7
|
+
data.tar.gz: acc364674adf6acb9ea229434d7a16fd7c7131023ef273072b7b2b4466b99251aeed780dd405ef92164df778042ecf5b4ed981c4a9395e6199325f7baf69d967
|
@@ -21,9 +21,15 @@ module PhantomForms
|
|
21
21
|
define_method(method_name) do |name, *args|
|
22
22
|
options = args.extract_options!.symbolize_keys!
|
23
23
|
content_tag :div, class: "form-group" do
|
24
|
-
|
24
|
+
#Empty label for hstore inputs. Example: label: nil
|
25
|
+
label = options[:label].nil? ? content_tag(:span, nil) : label(name, options[:label], class: 'control-label')
|
26
|
+
label +
|
25
27
|
content_tag(:div, class: 'controls') do
|
26
|
-
|
28
|
+
if object.respond_to?(:errors)
|
29
|
+
help = object.errors[name].any? ? object.errors[name].join(', ') : options[:help]
|
30
|
+
else
|
31
|
+
help = nil
|
32
|
+
end
|
27
33
|
help = content_tag(@help_tag, class: @help_css) { help } if help
|
28
34
|
options[:class] = options[:class].to_s + " form-control"
|
29
35
|
args << options.except(:label, :help)
|
@@ -47,4 +53,4 @@ module PhantomForms
|
|
47
53
|
end
|
48
54
|
|
49
55
|
end
|
50
|
-
end
|
56
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phantom_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.alpha5
|
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-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails4_client_side_validations
|
@@ -96,3 +96,4 @@ signing_key:
|
|
96
96
|
specification_version: 4
|
97
97
|
summary: Phantom Forms
|
98
98
|
test_files: []
|
99
|
+
has_rdoc:
|