govuk_elements_form_builder 1.1.0 → 1.2.0

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: 09e273646a0e9edb0788ac45e25409e98a8a815f
4
- data.tar.gz: aa0abb864b6b38852ac96005461c204ab031e9c6
3
+ metadata.gz: 7c1fe9769627ab203eb5a9740ea7e576cc48208b
4
+ data.tar.gz: 07647b82107b4bd8405e612ee8345272edabf7be
5
5
  SHA512:
6
- metadata.gz: 59ad72a527811abca00667b6f8457d790310b3e8d230509f56883b0b60c6218a87356ed2618a48f8fc324fca78e13e65102e16035c7bf62ae28afe87a367b31b
7
- data.tar.gz: 1fdea4d35a4ce12392e26eeedef890d07261422d995bf43236d30a40bd27b24e6023a142c8077b857687cbaddce846da0c8543841282f0b3a1ad550eab1d0699
6
+ metadata.gz: 32bfcdcca34abce386ce9300ce2aebc7b78ab81d970ba072fd72c9255d01609845a3e9f04de2836fc473ffbf9b23774ee55167f44cecd289e4cbc0d7f68efb40
7
+ data.tar.gz: 7751a56bcbafdaf667e661539a2bca6417c50c29eae09e8918c00a0b987d8f8d5203e6a73e648b9a8cf56fd01ff79bd4f24996ace9d8a67221fb3c78571e8be4
@@ -82,7 +82,45 @@ module GovukElementsFormBuilder
82
82
 
83
83
  (label+ super(method, collection, value_method, text_method, options , html_options)).html_safe
84
84
  end
85
+ end
86
+
87
+ def collection_check_boxes method, collection, value_method, text_method, options = {}, *args
88
+ content_tag :div,
89
+ class: form_group_classes(method),
90
+ id: form_group_id(method) do
91
+ content_tag :fieldset, fieldset_options(method, options) do
92
+ legend_key = method
93
+ legend = fieldset_legend(legend_key, options)
94
+
95
+ collection = super(method, collection, value_method, text_method, options) do |b|
96
+ content_tag :div, class: "multiple-choice" do
97
+ b.check_box + b.label
98
+ end
99
+ end
100
+
101
+ (legend + collection).html_safe
102
+ end
103
+ end
104
+ end
85
105
 
106
+ def collection_radio_buttons method, collection, value_method, text_method, options = {}, *args
107
+ content_tag :div,
108
+ class: form_group_classes(method),
109
+ id: form_group_id(method) do
110
+ content_tag :fieldset, fieldset_options(method, options) do
111
+
112
+ legend_key = method
113
+ legend = fieldset_legend(legend_key, options)
114
+
115
+ collection = super(method, collection, value_method, text_method, options) do |b|
116
+ content_tag :div, class: "multiple-choice" do
117
+ b.radio_button + b.label
118
+ end
119
+ end
120
+
121
+ (legend + collection).html_safe
122
+ end
123
+ end
86
124
  end
87
125
 
88
126
  # The following method will generate revealing panel markup and internally call the
@@ -1,3 +1,3 @@
1
1
  module GovukElementsFormBuilder
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_elements_form_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alistair Laing
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-22 00:00:00.000000000 Z
12
+ date: 2018-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  requirements: []
190
190
  rubyforge_project:
191
- rubygems_version: 2.6.4
191
+ rubygems_version: 2.5.1
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: Ruby on Rails form builder that generates GOV.UK elements styled markup for