formtastic-bootstrap 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +5 -3
- data/Gemfile.lock +72 -60
- data/README.md +4 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/formtastic-bootstrap.gemspec +49 -16
- data/lib/formtastic-bootstrap/actions/base.rb +22 -0
- data/lib/formtastic-bootstrap/actions/button_action.rb +13 -0
- data/lib/formtastic-bootstrap/actions/input_action.rb +13 -0
- data/lib/formtastic-bootstrap/actions/link_action.rb +12 -0
- data/lib/formtastic-bootstrap/actions.rb +10 -0
- data/lib/formtastic-bootstrap/form_builder.rb +4 -2
- data/lib/formtastic-bootstrap/helpers/action_helper.rb +12 -0
- data/lib/formtastic-bootstrap/helpers/actions_helper.rb +24 -0
- data/lib/formtastic-bootstrap/helpers/fieldset_wrapper.rb +2 -4
- data/lib/formtastic-bootstrap/helpers/inputs_helper.rb +0 -2
- data/lib/formtastic-bootstrap/helpers.rb +6 -8
- data/lib/formtastic-bootstrap/inputs/base/choices.rb +6 -35
- data/lib/formtastic-bootstrap/inputs/base/collections.rb +9 -0
- data/lib/formtastic-bootstrap/inputs/base/grouped_collections.rb +9 -0
- data/lib/formtastic-bootstrap/inputs/base/hints.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/base/labelling.rb +14 -3
- data/lib/formtastic-bootstrap/inputs/base/numeric.rb +9 -0
- data/lib/formtastic-bootstrap/inputs/base/stringish.rb +4 -5
- data/lib/formtastic-bootstrap/inputs/base/timeish.rb +38 -18
- data/lib/formtastic-bootstrap/inputs/base/wrapping.rb +22 -34
- data/lib/formtastic-bootstrap/inputs/base.rb +29 -6
- data/lib/formtastic-bootstrap/inputs/boolean_input.rb +14 -18
- data/lib/formtastic-bootstrap/inputs/check_boxes_input.rb +16 -11
- data/lib/formtastic-bootstrap/inputs/date_input.rb +3 -9
- data/lib/formtastic-bootstrap/inputs/date_select_input.rb +8 -0
- data/lib/formtastic-bootstrap/inputs/datetime_input.rb +3 -12
- data/lib/formtastic-bootstrap/inputs/datetime_select_input.rb +8 -0
- data/lib/formtastic-bootstrap/inputs/email_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/file_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/hidden_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/number_input.rb +3 -3
- data/lib/formtastic-bootstrap/inputs/password_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/phone_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/radio_input.rb +28 -14
- data/lib/formtastic-bootstrap/inputs/range_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/search_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/select_input.rb +3 -1
- data/lib/formtastic-bootstrap/inputs/string_input.rb +0 -7
- data/lib/formtastic-bootstrap/inputs/text_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/time_input.rb +3 -9
- data/lib/formtastic-bootstrap/inputs/time_select_input.rb +8 -0
- data/lib/formtastic-bootstrap/inputs/time_zone_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/url_input.rb +1 -1
- data/lib/formtastic-bootstrap/inputs.rb +30 -23
- data/lib/formtastic-bootstrap.rb +16 -1
- data/spec/actions/button_action_spec.rb +63 -0
- data/spec/actions/input_action_spec.rb +59 -0
- data/spec/actions/link_action_spec.rb +92 -0
- data/spec/helpers/action_helper_spec.rb +368 -0
- data/spec/helpers/actions_helper_spec.rb +147 -0
- data/spec/helpers/input_helper_spec.rb +238 -259
- data/spec/helpers/inputs_helper_spec.rb +84 -25
- data/spec/inputs/boolean_input_spec.rb +108 -75
- data/spec/inputs/check_boxes_input_spec.rb +106 -91
- data/spec/inputs/date_select_input_spec.rb +164 -0
- data/spec/inputs/datetime_select_input_spec.rb +112 -0
- data/spec/inputs/deprecated_time_date_datetime_inputs_spec.rb +48 -0
- data/spec/inputs/email_input_spec.rb +30 -3
- data/spec/inputs/file_input_spec.rb +31 -4
- data/spec/inputs/hidden_input_spec.rb +63 -32
- data/spec/inputs/number_input_spec.rb +37 -8
- data/spec/inputs/password_input_spec.rb +30 -3
- data/spec/inputs/phone_input_spec.rb +30 -3
- data/spec/inputs/radio_input_spec.rb +87 -60
- data/spec/inputs/range_input_spec.rb +32 -5
- data/spec/inputs/search_input_spec.rb +29 -3
- data/spec/inputs/select_input_spec.rb +164 -107
- data/spec/inputs/string_input_spec.rb +33 -22
- data/spec/inputs/text_input_spec.rb +39 -14
- data/spec/inputs/time_select_input_spec.rb +191 -0
- data/spec/inputs/time_zone_input_spec.rb +17 -19
- data/spec/inputs/url_input_spec.rb +30 -3
- data/spec/spec_helper.rb +21 -15
- data/spec/support/custom_macros.rb +61 -228
- data/spec/support/fb_custom_macros.rb +23 -0
- metadata +109 -28
- data/lib/formtastic-bootstrap/helpers/buttons_helper.rb +0 -52
- data/spec/builder/errors_spec.rb +0 -214
- data/spec/helpers/buttons_helper_spec.rb +0 -149
- data/spec/inputs/date_input_spec.rb +0 -147
- data/spec/inputs/datetime_input_spec.rb +0 -101
- data/spec/inputs/time_input_spec.rb +0 -206
- data/spec/support/depracation.rb +0 -6
- data/spec/support/formtastic_spec_helper.rb +0 -382
@@ -5,7 +5,7 @@ module FormtasticBootstrap
|
|
5
5
|
|
6
6
|
include Formtastic::Inputs::Base::Hints
|
7
7
|
|
8
|
-
def hint_html(inline_or_block = :
|
8
|
+
def hint_html(inline_or_block = :block)
|
9
9
|
if hint?
|
10
10
|
hint_class = if inline_or_block == :inline
|
11
11
|
options[:hint_class] || builder.default_inline_hint_class
|
@@ -6,12 +6,23 @@ module FormtasticBootstrap
|
|
6
6
|
include Formtastic::Inputs::Base::Labelling
|
7
7
|
|
8
8
|
def label_html_options
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
super.tap do |options|
|
10
|
+
# Bootstrap defines class 'label'
|
11
|
+
options[:class] = options[:class].reject { |c| c == 'label' }
|
12
|
+
# options[:class] << "control-label"
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
16
|
+
def control_label_html_options
|
17
|
+
label_html_options.tap do |options|
|
18
|
+
options[:class] << "control-label"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def control_label_html
|
23
|
+
render_label? ? builder.label(input_name, label_text, control_label_html_options) : "".html_safe
|
24
|
+
end
|
25
|
+
|
15
26
|
end
|
16
27
|
end
|
17
28
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Alas, I need to duplicate code from Formtastic::Inputs::Base::Stringish because
|
2
|
-
# there's no way to re-import that module.
|
3
1
|
module FormtasticBootstrap
|
4
2
|
module Inputs
|
5
3
|
module Base
|
@@ -7,9 +5,10 @@ module FormtasticBootstrap
|
|
7
5
|
|
8
6
|
include Formtastic::Inputs::Base::Stringish
|
9
7
|
|
10
|
-
def
|
11
|
-
|
12
|
-
|
8
|
+
def to_html
|
9
|
+
bootstrap_wrapping do
|
10
|
+
builder.text_field(method, input_html_options)
|
11
|
+
end
|
13
12
|
end
|
14
13
|
|
15
14
|
end
|
@@ -3,32 +3,52 @@ module FormtasticBootstrap
|
|
3
3
|
module Base
|
4
4
|
module Timeish
|
5
5
|
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
def to_html
|
7
|
+
control_group_wrapping do
|
8
|
+
control_label_html <<
|
9
|
+
controls_wrapping do
|
10
|
+
hidden_fragments <<
|
11
|
+
fragments.map do |fragment|
|
12
|
+
fragment_input_html(fragment)
|
13
|
+
end.join.html_safe
|
14
|
+
end
|
10
15
|
end
|
11
16
|
end
|
12
17
|
|
13
|
-
def
|
14
|
-
|
18
|
+
def controls_wrapper_html_options
|
19
|
+
super.tap do |options|
|
20
|
+
options[:class] = (options[:class].split << "controls-row").join(" ")
|
21
|
+
end
|
15
22
|
end
|
16
23
|
|
17
|
-
def
|
18
|
-
|
24
|
+
def fragment_input_html(fragment)
|
25
|
+
opts = input_options.merge(:prefix => fragment_prefix, :field_name => fragment_name(fragment), :default => value, :include_blank => include_blank?)
|
26
|
+
template.send(:"select_#{fragment}", value, opts, fragment_input_html_options(fragment))
|
19
27
|
end
|
20
|
-
|
21
|
-
def
|
22
|
-
|
23
|
-
|
24
|
-
|
28
|
+
|
29
|
+
def fragment_input_html_options(fragment)
|
30
|
+
input_html_options.tap do |options|
|
31
|
+
options[:id] = fragment_id(fragment)
|
32
|
+
options[:class] = ((options[:class] || "").split << fragment_class(fragment)).join(" ")
|
33
|
+
options[:placeholder] = fragment_placeholder(fragment)
|
34
|
+
end
|
25
35
|
end
|
26
|
-
|
27
|
-
def
|
28
|
-
|
29
|
-
|
36
|
+
|
37
|
+
def fragment_class(fragment)
|
38
|
+
{
|
39
|
+
:year => "span1",
|
40
|
+
:month => "span2",
|
41
|
+
:day => "span1",
|
42
|
+
:hour => "span1",
|
43
|
+
:minute => "span1",
|
44
|
+
:second => "span1"
|
45
|
+
}[fragment]
|
30
46
|
end
|
31
|
-
|
47
|
+
|
48
|
+
def fragment_placeholder(fragment)
|
49
|
+
"." + fragment_class(fragment)
|
50
|
+
end
|
51
|
+
|
32
52
|
end
|
33
53
|
end
|
34
54
|
end
|
@@ -5,57 +5,45 @@ module FormtasticBootstrap
|
|
5
5
|
|
6
6
|
include Formtastic::Inputs::Base::Wrapping
|
7
7
|
|
8
|
-
def
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
def bootstrap_wrapping(&block)
|
9
|
+
control_group_wrapping do
|
10
|
+
control_label_html <<
|
11
|
+
controls_wrapping do
|
12
12
|
if options[:prepend]
|
13
13
|
prepended_input_wrapping do
|
14
|
-
[template.content_tag(:span, options[:prepend], :class => 'add-on'), yield].join("\n").html_safe
|
14
|
+
[template.content_tag(:span, options[:prepend], :class => 'add-on'), yield, hint_html].join("\n").html_safe
|
15
15
|
end
|
16
16
|
else
|
17
|
-
yield
|
17
|
+
[yield, hint_html].join("\n").html_safe
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
template.content_tag(:div,
|
25
|
-
|
26
|
-
|
23
|
+
def control_group_wrapping(&block)
|
24
|
+
template.content_tag(:div,
|
25
|
+
[template.capture(&block), error_html].join("\n").html_safe,
|
26
|
+
wrapper_html_options
|
27
|
+
)
|
27
28
|
end
|
28
29
|
|
29
|
-
def
|
30
|
-
template.content_tag(:div,
|
31
|
-
[yield, error_html(inline_or_block_errors), hint_html(inline_or_block_errors)].join("\n").html_safe
|
32
|
-
end
|
30
|
+
def controls_wrapping(&block)
|
31
|
+
template.content_tag(:div, template.capture(&block).html_safe, controls_wrapper_html_options)
|
33
32
|
end
|
34
|
-
|
35
|
-
def
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
|
34
|
+
def controls_wrapper_html_options
|
35
|
+
{
|
36
|
+
:class => "controls"
|
37
|
+
}
|
39
38
|
end
|
40
39
|
|
41
40
|
def wrapper_html_options
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
opts[:class] << as
|
46
|
-
opts[:class] << "clearfix"
|
47
|
-
# opts[:class] << "input"
|
48
|
-
opts[:class] << "error" if errors?
|
49
|
-
opts[:class] << "optional" if optional?
|
50
|
-
opts[:class] << "required" if required?
|
51
|
-
opts[:class] << "autofocus" if autofocus?
|
52
|
-
opts[:class] = opts[:class].join(' ')
|
53
|
-
|
54
|
-
opts[:id] ||= wrapper_dom_id
|
55
|
-
|
56
|
-
opts
|
41
|
+
super.tap do |options|
|
42
|
+
options[:class] << " control-group"
|
43
|
+
end
|
57
44
|
end
|
58
45
|
|
46
|
+
# Bootstrap prepend feature
|
59
47
|
def prepended_input_wrapping(&block)
|
60
48
|
template.content_tag(:div, :class => 'input-prepend') do
|
61
49
|
yield
|
@@ -1,22 +1,45 @@
|
|
1
|
-
require "formtastic-bootstrap/inputs/base/choices"
|
2
1
|
require "formtastic-bootstrap/inputs/base/errors"
|
3
2
|
require "formtastic-bootstrap/inputs/base/hints"
|
4
3
|
require "formtastic-bootstrap/inputs/base/html"
|
5
4
|
require "formtastic-bootstrap/inputs/base/labelling"
|
6
|
-
require "formtastic-bootstrap/inputs/base/stringish"
|
7
|
-
require "formtastic-bootstrap/inputs/base/timeish"
|
8
|
-
require "formtastic-bootstrap/inputs/base/wrapping"
|
9
5
|
|
10
6
|
module FormtasticBootstrap
|
11
7
|
module Inputs
|
12
8
|
module Base
|
13
9
|
|
10
|
+
# autoload :DatetimePickerish
|
11
|
+
# autoload :Associations
|
12
|
+
autoload :Collections, "formtastic-bootstrap/inputs/base/collections"
|
13
|
+
autoload :Choices, "formtastic-bootstrap/inputs/base/choices"
|
14
|
+
# autoload :Database
|
15
|
+
# autoload :Errors
|
16
|
+
# autoload :Fileish
|
17
|
+
autoload :GroupedCollections, "formtastic-bootstrap/inputs/base/grouped_collections"
|
18
|
+
# autoload :Hints
|
19
|
+
# autoload :Html
|
20
|
+
# autoload :Labelling
|
21
|
+
# autoload :Naming
|
22
|
+
autoload :Numeric, "formtastic-bootstrap/inputs/base/numeric"
|
23
|
+
# autoload :Options
|
24
|
+
# autoload :Placeholder
|
25
|
+
autoload :Stringish, "formtastic-bootstrap/inputs/base/stringish"
|
26
|
+
autoload :Timeish, "formtastic-bootstrap/inputs/base/timeish"
|
27
|
+
# autoload :Validations
|
28
|
+
autoload :Wrapping, "formtastic-bootstrap/inputs/base/wrapping"
|
29
|
+
|
30
|
+
include Html
|
31
|
+
# include Options
|
32
|
+
# include Database
|
33
|
+
# include Database
|
14
34
|
include Errors
|
15
35
|
include Hints
|
16
|
-
include
|
36
|
+
# include Naming
|
37
|
+
# include Validations
|
38
|
+
# include Fileish
|
39
|
+
# include Associations
|
17
40
|
include Labelling
|
18
41
|
include Wrapping
|
19
|
-
|
42
|
+
|
20
43
|
end
|
21
44
|
end
|
22
45
|
end
|
@@ -2,30 +2,26 @@
|
|
2
2
|
module FormtasticBootstrap
|
3
3
|
module Inputs
|
4
4
|
class BooleanInput < Formtastic::Inputs::BooleanInput
|
5
|
-
include Base
|
6
|
-
|
5
|
+
include Base
|
6
|
+
|
7
7
|
def to_html
|
8
|
-
|
9
|
-
|
8
|
+
control_group_wrapping do
|
9
|
+
control_label_html <<
|
10
10
|
hidden_field_html <<
|
11
|
-
|
12
|
-
|
13
|
-
template.content_tag(:li) do
|
14
|
-
label_with_nested_checkbox
|
15
|
-
end
|
16
|
-
end
|
11
|
+
controls_wrapping do
|
12
|
+
label_with_nested_checkbox
|
17
13
|
end
|
18
14
|
end
|
19
15
|
end
|
20
16
|
|
21
|
-
def
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
17
|
+
def label_with_nested_checkbox
|
18
|
+
builder.label(
|
19
|
+
method,
|
20
|
+
label_text_with_embedded_checkbox,
|
21
|
+
label_html_options.tap do |options|
|
22
|
+
options[:class] << "checkbox"
|
23
|
+
end
|
24
|
+
)
|
29
25
|
end
|
30
26
|
|
31
27
|
end
|
@@ -4,29 +4,34 @@ module FormtasticBootstrap
|
|
4
4
|
include Base
|
5
5
|
include Base::Choices
|
6
6
|
|
7
|
+
# TODO Make sure help blocks work correctly.
|
8
|
+
# TODO Support .inline
|
9
|
+
|
7
10
|
def to_html
|
8
|
-
|
9
|
-
|
11
|
+
control_group_wrapping do
|
12
|
+
control_label_html <<
|
10
13
|
hidden_field_for_all <<
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
choice_html(choice)
|
16
|
-
end
|
17
|
-
}.join("\n").html_safe
|
18
|
-
end
|
14
|
+
controls_wrapping do
|
15
|
+
collection.map { |choice|
|
16
|
+
choice_html(choice)
|
17
|
+
}.join("\n").html_safe
|
19
18
|
end
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
22
|
+
def choice_wrapping_html_options(choice)
|
23
|
+
super(choice).tap do |options|
|
24
|
+
options[:class] = ((options[:class].split) << "checkbox").join(" ")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
23
28
|
def choice_html(choice)
|
24
29
|
template.content_tag(:label,
|
25
30
|
hidden_fields? ?
|
26
31
|
check_box_with_hidden_input(choice) :
|
27
32
|
check_box_without_hidden_input(choice) <<
|
28
33
|
choice_label(choice),
|
29
|
-
label_html_options.merge(
|
34
|
+
label_html_options.merge(choice_label_html_options(choice))
|
30
35
|
)
|
31
36
|
end
|
32
37
|
|
@@ -1,16 +1,10 @@
|
|
1
1
|
module FormtasticBootstrap
|
2
2
|
module Inputs
|
3
|
-
class DateInput <
|
4
|
-
include Base
|
5
|
-
include Base::Stringish
|
6
|
-
include Base::Timeish
|
7
|
-
|
3
|
+
class DateInput < FormtasticBootstrap::Inputs::DateSelectInput
|
8
4
|
def to_html
|
9
|
-
|
10
|
-
|
11
|
-
end
|
5
|
+
::ActiveSupport::Deprecation.warn("DateInput (:as => :date) has been renamed to DateSelectInput (:as => :date_select) and will be removed or changed in the next version of Formtastic, please update your forms.", caller(2))
|
6
|
+
super
|
12
7
|
end
|
13
|
-
|
14
8
|
end
|
15
9
|
end
|
16
10
|
end
|
@@ -1,19 +1,10 @@
|
|
1
1
|
module FormtasticBootstrap
|
2
2
|
module Inputs
|
3
|
-
class DatetimeInput <
|
4
|
-
include Base
|
5
|
-
include Base::Stringish
|
6
|
-
include Base::Timeish
|
7
|
-
|
3
|
+
class DatetimeInput < FormtasticBootstrap::Inputs::DatetimeSelectInput
|
8
4
|
def to_html
|
9
|
-
|
10
|
-
|
11
|
-
# This newline matters.
|
12
|
-
date_input_html << "\n".html_safe << time_input_html
|
13
|
-
end
|
14
|
-
end
|
5
|
+
::ActiveSupport::Deprecation.warn("DatetimeInput (:as => :datetime) has been renamed to DatetimeSelectInput (:as => :datetime_select) and will be removed or changed in the next version of Formtastic, please update your forms.", caller(2))
|
6
|
+
super
|
15
7
|
end
|
16
|
-
|
17
8
|
end
|
18
9
|
end
|
19
10
|
end
|
@@ -2,14 +2,14 @@ module FormtasticBootstrap
|
|
2
2
|
module Inputs
|
3
3
|
class NumberInput < Formtastic::Inputs::NumberInput
|
4
4
|
include Base
|
5
|
-
include Base::
|
5
|
+
include Base::Numeric
|
6
6
|
|
7
7
|
def to_html
|
8
|
-
|
8
|
+
bootstrap_wrapping do
|
9
9
|
builder.number_field(method, input_html_options)
|
10
10
|
end
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -4,29 +4,43 @@ module FormtasticBootstrap
|
|
4
4
|
include Base
|
5
5
|
include Base::Choices
|
6
6
|
|
7
|
+
# TODO Make sure help blocks work correctly.
|
8
|
+
# TODO Support .inline
|
9
|
+
|
7
10
|
def to_html
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
choice_html(choice)
|
15
|
-
end
|
16
|
-
}.join("\n").html_safe
|
17
|
-
end
|
11
|
+
control_group_wrapping do
|
12
|
+
control_label_html <<
|
13
|
+
controls_wrapping do
|
14
|
+
collection.map { |choice|
|
15
|
+
choice_html(choice)
|
16
|
+
}.join("\n").html_safe
|
18
17
|
end
|
19
18
|
end
|
20
19
|
end
|
21
20
|
|
22
|
-
def
|
23
|
-
|
24
|
-
|
21
|
+
def wrapper_html_options
|
22
|
+
# Formtastic marks these as 'radio' but Bootstrap does something
|
23
|
+
# with that, so change it to 'radio_buttons'.
|
24
|
+
super.tap do |options|
|
25
|
+
options[:class] = options[:class].gsub("radio", "radio_buttons")
|
26
|
+
end
|
27
|
+
end
|
25
28
|
|
26
|
-
|
29
|
+
# This came from check_boxes. Do needed refactoring.
|
30
|
+
def choice_wrapping_html_options(choice)
|
31
|
+
super(choice).tap do |options|
|
32
|
+
options[:class] = ((options[:class].split) << "radio").join(" ")
|
27
33
|
end
|
28
34
|
end
|
29
35
|
|
36
|
+
def choice_html(choice)
|
37
|
+
template.content_tag(:label,
|
38
|
+
builder.radio_button(input_name, choice_value(choice), input_html_options.merge(choice_html_options(choice)).merge(:required => false)) <<
|
39
|
+
choice_label(choice),
|
40
|
+
label_html_options.merge(choice_label_html_options(choice))
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
30
44
|
end
|
31
45
|
end
|
32
46
|
end
|
@@ -2,9 +2,11 @@ module FormtasticBootstrap
|
|
2
2
|
module Inputs
|
3
3
|
class SelectInput < Formtastic::Inputs::SelectInput
|
4
4
|
include Base
|
5
|
+
include Base::Collections
|
6
|
+
include Base::GroupedCollections
|
5
7
|
|
6
8
|
def to_html
|
7
|
-
|
9
|
+
bootstrap_wrapping do
|
8
10
|
options[:group_by] ? grouped_select_html : select_html
|
9
11
|
end
|
10
12
|
end
|
@@ -1,16 +1,10 @@
|
|
1
1
|
module FormtasticBootstrap
|
2
2
|
module Inputs
|
3
|
-
class TimeInput <
|
4
|
-
include Base
|
5
|
-
include Base::Stringish
|
6
|
-
include Base::Timeish
|
7
|
-
|
3
|
+
class TimeInput < FormtasticBootstrap::Inputs::TimeSelectInput
|
8
4
|
def to_html
|
9
|
-
|
10
|
-
|
11
|
-
end
|
5
|
+
::ActiveSupport::Deprecation.warn("TimeInput (:as => :time) has been renamed to TimeSelectInput (:as => :time_select) and will be removed or changed in the next version of Formtastic, please update your forms.", caller(2))
|
6
|
+
super
|
12
7
|
end
|
13
|
-
|
14
8
|
end
|
15
9
|
end
|
16
10
|
end
|