phantom_forms 0.2.0.alpha4 → 0.2.0.alpha5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c69885ce921dd10232efa37b4ed63d99497923e
4
- data.tar.gz: 6a5921e92bd916b4c84d33fd89fd8e32d33f6792
3
+ metadata.gz: d3c60eead7eac9cca67438ea6624493112a2ddd0
4
+ data.tar.gz: c2def94d82602f6031d228c0b68ba9a3e3bbf30e
5
5
  SHA512:
6
- metadata.gz: e5755d76667f5f4fe64f16843f53232d3169753af496eafdfc34ed555dd1258bac39b12931b5bb13319fe1f7ebb741d2cdaa387a5142c54b819c667c3ce762f3
7
- data.tar.gz: ed72afaaf67da64fa4b2eb1c96cb0a19cc8052859fe5c7cab4dc22cba081e82f4f7b0fcb7665d58ebfd45d5040e65cf0495b68a5529703f76cd36f74694706a6
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
- label(name, options[:label], class: 'control-label') +
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
- help = object.errors[name].any? ? object.errors[name].join(', ') : options[:help]
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.alpha4
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-21 00:00:00.000000000 Z
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: