govuk_elements_form_builder 0.0.3 → 0.0.4
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: 475401203a5c26078dbc79f8f6d6c494b01728a5
|
4
|
+
data.tar.gz: e61aa54296d87f99ac76edd48fb39cf9279e5ceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76a3eaeb0c325a24b1071df6e1d7db2a6c9653b14910b0ef373c4b00a6c1b17ddfa7b87de92877b62ac501761cc217efa68060e13bbc6a095a6313bd04bc01d5
|
7
|
+
data.tar.gz: 27f5f53f9da16ab85175ab5410ebc7d1be5e54d8b9d9919b93ec4153bcc16d55cacdb5c5c057148d63ab296613e1e0942a6470f8399d748ce48f2816e2735810
|
@@ -104,9 +104,17 @@ module GovukElementsFormBuilder
|
|
104
104
|
def radio_inputs attribute, options
|
105
105
|
choices = options[:choices] || [ :yes, :no ]
|
106
106
|
choices.map do |choice|
|
107
|
-
|
108
|
-
|
109
|
-
|
107
|
+
value = choice.send(options[:value_method] || :to_s)
|
108
|
+
label attribute,
|
109
|
+
class: 'block-label selection-button-radio',
|
110
|
+
value: value do |tag|
|
111
|
+
input = radio_button(attribute, value)
|
112
|
+
text = if options.has_key? :text_method
|
113
|
+
choice.send(options[:text_method])
|
114
|
+
else
|
115
|
+
localized_label("#{attribute}.#{choice}")
|
116
|
+
end
|
117
|
+
input + text
|
110
118
|
end
|
111
119
|
end
|
112
120
|
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: 0.0.
|
4
|
+
version: 0.0.4
|
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: 2017-03-
|
12
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|