bs_form_builder 0.2.1 → 0.2.2
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: fddeb45553b47219d84a9d3da2a6dfdf365608a2
|
4
|
+
data.tar.gz: c6e83a3f301ca44f326dff1e563d43ffaeecf2bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f312cb5a7691aaead3cbd19e1f3b7565cfe5000ad4ef951ce91defdcefed979c75bf543585449f387e5c0c84b7b1d29cd4290743f062358d8a03b017b0cfe9ad
|
7
|
+
data.tar.gz: 38a47b35db722d0c7e569a96c34b22c06027e1059ea4a0be1d3e9dcf025e54dd666cec32ceb8cb6b3d597ab0af33129966cfdf0568eacefc826fc519c05b1eb6
|
@@ -119,6 +119,31 @@ class BootstrapFormBuilder::HorizontalFormBuilder < ActionView::Helpers::FormBui
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
+
def radio_group(name, button_options, opts = {})
|
123
|
+
form_group(name, opts.slice(:label_options, :group_options, :tip_options)) do
|
124
|
+
buttons = button_options.map do |button|
|
125
|
+
radio_label(name, button)
|
126
|
+
end.join("\n").html_safe
|
127
|
+
|
128
|
+
@template.content_tag(:div,
|
129
|
+
buttons,
|
130
|
+
:class => 'radio-group',
|
131
|
+
:data => validation_attributes(name))
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def radio_label(name, button)
|
136
|
+
label = label("#{name}_#{button}", :class => 'radio-label') do
|
137
|
+
radio_button(name, button) +
|
138
|
+
I18n.t("#{object_name}.#{name}_options.#{button}",
|
139
|
+
:scope => "helpers.label")
|
140
|
+
end
|
141
|
+
|
142
|
+
@template.content_tag(:div,
|
143
|
+
label,
|
144
|
+
:class => 'radio')
|
145
|
+
end
|
146
|
+
|
122
147
|
def select(name, choices, options = {}, html_options = {})
|
123
148
|
form_group(name, options.slice(:label_options, :group_options, :tip_options)) do
|
124
149
|
super(name, choices, options,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bs_form_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Geoghegan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|