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: 801fcfa6098304541550b4b4d70d2dcb5cc5ff44
4
- data.tar.gz: a9f7a346372eec2d82bb1da7487eb5e40335f83f
3
+ metadata.gz: fddeb45553b47219d84a9d3da2a6dfdf365608a2
4
+ data.tar.gz: c6e83a3f301ca44f326dff1e563d43ffaeecf2bf
5
5
  SHA512:
6
- metadata.gz: 715f5880cf03e05e206a48eacfe34f47973a2cad749d13dfccaecf8c25c2a6a0d03e549720e5083d449dc543e80ebc19ad248c28af28f07caddd44c8367ed09e
7
- data.tar.gz: 09c8fd04c2ea9281c8d6a82e9f0ae1c3b44f89839bab599c1c72c5ced839a8ac7a1ef5ab472295ec27144da995227e173d2ee3a29c2c5928a48e7dfdd506fd55
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,
@@ -1,3 +1,3 @@
1
1
  module BootstrapFormBuilder
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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-21 00:00:00.000000000 Z
11
+ date: 2014-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview