Sha256: ecb71418021c6f38fe34a1d18f750b1686a40175747d222f67213e53454be006
Contents?: true
Size: 787 Bytes
Versions: 6
Compression:
Stored size: 787 Bytes
Contents
module SimpleForm class DefaultFormBuilder < SimpleForm::FormBuilder CHECKBOX_WRAPPER = :checkbox RADIO_WRAPPER = :radio map_type :datetime, to: SimpleForm::Inputs::DateTimePickerInput map_type :date, to: SimpleForm::Inputs::DatePickerInput def checkbox(attribute_name, options = {}, &block) options[:wrapper] ||= self.class::CHECKBOX_WRAPPER options[:as] ||= :boolean input attribute_name, options, &block end def radio(attribute_name, options = {}, &block) options[:wrapper] ||= self.class::RADIO_WRAPPER input attribute_name, options, &block end def input(attribute_name, options = {}, &block) options[:wrapper] ||= self.class::CHECKBOX_WRAPPER if options[:as] == :boolean super end end end
Version data entries
6 entries across 6 versions & 1 rubygems