Cross Reference: simple_form_fixes.rb
xref
: /
ontohub
/
config
/
initializers
/
simple_form_fixes.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
simple_form_fixes.rb revision 0d59c6dbb8feb77c3e318463d080a080f7e0d045
# Compatibility between simple_form
2.x
and bootstrap 3
#
http://www.iconoclastlabs.com/blog/using-twitter-bootstrap-3-with-simple_form
inputs
= %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
RangeInput
StringInput
TextInput
]
inputs.each
do
|
input_type
|
superclass
=
"SimpleForm::Inputs::#{input_type}"
.
constantize
new_class
=
Class.new
(
superclass
)
do
def
input_html_classes
super.push
(
'form-control'
)
end
end
Object.const
_set
(
input_type
,
new_class
)
end