formnestic 1.0.7 → 1.0.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
- SHA1:
3
- metadata.gz: 2efafe689f391ab0a0771c1d5b13786194905218
4
- data.tar.gz: 5dffa27fc75df13805da4ef765f4efd1bbe573a4
2
+ SHA256:
3
+ metadata.gz: 3dd0bc0425d77a4cd8462fca70aa96a62ce58074501803e19c99d5b502f89b4a
4
+ data.tar.gz: 74dbbfd7b390e44634908d16b8a6cf6361732af0e518970bb6397de064394e45
5
5
  SHA512:
6
- metadata.gz: 6fe94b00531903a3ceaf7501b2057410b3069cfb07cfaac4273c092b70340a4aa61d94e31ceb8b866274d00dd8054d8a5377239acf524439dd257f50479cbe59
7
- data.tar.gz: eea158cd30f720f04e435a6cb2c2a631439a5b13e19b6a1ef3d70f2ce74a2299603bc0168fb061c3baee3a37ecf4321be41bd002f528a7fd11d4a0506b3a6c7d
6
+ metadata.gz: b4c62189e490379215453b77c315ddcbf262ec91ee9877287ef56e30a6703fbb20dc4f42e30265f2e9da285db2647d6da2066e5dd181ea204b14ba9a0571a6f3
7
+ data.tar.gz: 3810b3d89604978d062945906a23666981bcc91930aee605200e8bc7408d316b3bc6e571a8ee90ace290f81586ba939ce07aa7411ea23b640670d966a94c33ac
data/formnestic.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'formnestic'
8
- s.version = '1.0.7'
8
+ s.version = '1.0.8'
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ['James']
@@ -184,7 +184,7 @@ module Formnestic
184
184
  )
185
185
  input_base.label_text
186
186
  elsif table_header_element_opts[:label].present?
187
- table_header_element_opts[:label]
187
+ table_header_element_opts[:label].html_safe
188
188
  else
189
189
  "Column #{position}"
190
190
  end
@@ -1,9 +1,31 @@
1
+ # rubocop:disable MethodLength, AbcSize
1
2
  module Formnestic
2
3
  module Inputs
3
4
  module Base
4
5
  module Wrapping
6
+ def table_builder?
7
+ builder.options[:display_type] == 'table' ||
8
+ if builder.options[:parent_builder]
9
+ builder
10
+ .options[:parent_builder]
11
+ .options[:display_type] == 'table'
12
+ else
13
+ false
14
+ end
15
+ end
16
+
17
+ def parent_table_builder?
18
+ if builder.options[:parent_builder]
19
+ builder
20
+ .options[:parent_builder]
21
+ .options[:display_type] == 'table'
22
+ else
23
+ false
24
+ end
25
+ end
26
+
5
27
  def input_wrapping(&block)
6
- if builder.options[:display_type] == 'table'
28
+ if table_builder?
7
29
  if [
8
30
  'Formtastic::Inputs::DateSelectInput',
9
31
  'Formtastic::Inputs::TimeSelectInput',
@@ -21,13 +43,16 @@ module Formnestic
21
43
  end
22
44
 
23
45
  def table_date_select_input_wrapping(&block)
24
- builder
25
- .options[:parent_builder]
26
- .add_table_header(
27
- attributized_method_name,
28
- self.class,
29
- label_text
30
- )
46
+ unless parent_table_builder?
47
+ builder
48
+ .options[:parent_builder]
49
+ .add_table_header(
50
+ attributized_method_name,
51
+ self.class,
52
+ label_text
53
+ )
54
+ end
55
+
31
56
  template.content_tag(
32
57
  :td,
33
58
  template.content_tag(
@@ -40,13 +65,15 @@ module Formnestic
40
65
  end
41
66
 
42
67
  def table_input_wrapping(&block)
43
- builder
44
- .options[:parent_builder]
45
- .add_table_header(
46
- attributized_method_name,
47
- self.class,
48
- label_text
49
- )
68
+ unless parent_table_builder?
69
+ builder
70
+ .options[:parent_builder]
71
+ .add_table_header(
72
+ attributized_method_name,
73
+ self.class,
74
+ label_text
75
+ )
76
+ end
50
77
 
51
78
  template.content_tag(
52
79
  :td,
@@ -62,3 +89,4 @@ module Formnestic
62
89
  end
63
90
  end
64
91
  end
92
+ # rubocop:enable MethodLength, AbcSize
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formnestic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.6.11
241
+ rubygems_version: 2.7.6
242
242
  signing_key:
243
243
  specification_version: 3
244
244
  summary: An extension of formtastic form builder gem