simple_form_bootstrap3 0.2.5 → 0.2.6
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: e94c74e8091471aff07ab15c16d8772d63dc8f0a
|
4
|
+
data.tar.gz: 4d28a10d595ad3434948a92b6302846c7eee0e1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7422f2c580b4482411baeeabc4a7f8f9705c59e49b3d184b4253885be272e549110925c9c363c6899b8b4aec1d57c4e54afaa056c3294d3d4eba76c07dda8d98
|
7
|
+
data.tar.gz: fbc753c7a4f2d976382f462a5d5959acac995a3c3c8d8448ff847475e812a10479cba4ac79fb1ef1192b62c94d9c57f36de6a501299631344a53a19213fa92bc
|
@@ -1,17 +1,25 @@
|
|
1
1
|
module SimpleForm
|
2
2
|
class DefaultFormBuilder < SimpleForm::FormBuilder
|
3
|
+
CHECKBOX_WRAPPER = :checkbox
|
4
|
+
RADIO_WRAPPER = :radio
|
5
|
+
|
3
6
|
map_type :datetime, to: SimpleForm::Inputs::DateTimePickerInput
|
4
7
|
map_type :date, to: SimpleForm::Inputs::DatePickerInput
|
5
8
|
|
6
9
|
def checkbox(attribute_name, options = {}, &block)
|
7
|
-
options[:wrapper] ||=
|
10
|
+
options[:wrapper] ||= self.class::CHECKBOX_WRAPPER
|
8
11
|
options[:as] ||= :boolean
|
9
12
|
input attribute_name, options, &block
|
10
13
|
end
|
11
14
|
|
12
15
|
def radio(attribute_name, options = {}, &block)
|
13
|
-
options[:wrapper] ||=
|
16
|
+
options[:wrapper] ||= self.class::RADIO_WRAPPER
|
14
17
|
input attribute_name, options, &block
|
15
18
|
end
|
19
|
+
|
20
|
+
def input(attribute_name, options = {}, &block)
|
21
|
+
options[:wrapper] ||= self.class::CHECKBOX_WRAPPER if options[:as] == :boolean
|
22
|
+
super
|
23
|
+
end
|
16
24
|
end
|
17
25
|
end
|
@@ -1,14 +1,7 @@
|
|
1
1
|
module SimpleForm
|
2
2
|
class HorizontalFormBuilder < SimpleForm::DefaultFormBuilder
|
3
|
-
|
4
|
-
|
5
|
-
super
|
6
|
-
end
|
7
|
-
|
8
|
-
def radio(attribute_name, options = {}, &block)
|
9
|
-
options[:wrapper] ||= :horizontal_radio
|
10
|
-
super
|
11
|
-
end
|
3
|
+
CHECKBOX_WRAPPER = :horizontal_checkbox
|
4
|
+
RADIO_WRAPPER = :horizontal_radio
|
12
5
|
|
13
6
|
def buttons(options = {}, &block)
|
14
7
|
raise ::ArgumentError unless block_given?
|
@@ -1,13 +1,6 @@
|
|
1
1
|
module SimpleForm
|
2
2
|
class InlineFormBuilder < SimpleForm::PlaceholderFormBuilder
|
3
|
-
|
4
|
-
|
5
|
-
super
|
6
|
-
end
|
7
|
-
|
8
|
-
def radio(attribute_name, options = {}, &block)
|
9
|
-
options[:wrapper] ||= :inline_radio
|
10
|
-
super
|
11
|
-
end
|
3
|
+
CHECKBOX_WRAPPER = :inline_checkbox
|
4
|
+
RADIO_WRAPPER = :inline_radio
|
12
5
|
end
|
13
6
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form_bootstrap3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuriy Kolodovskyy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap-sass
|