Sha256: 85467a313119adcef72a48b68af68639da1339746d9a8c914ec271ceb834e227
Contents?: true
Size: 1001 Bytes
Versions: 1
Compression:
Stored size: 1001 Bytes
Contents
module SimpleForm class HorizontalFormBuilder < SimpleForm::DefaultFormBuilder CHECKBOX_WRAPPER = :horizontal_checkbox RADIO_WRAPPER = :horizontal_radio def buttons(options = {}, &block) raise ::ArgumentError unless block_given? options[:class] ||= 'col-sm-offset-3 col-sm-9 col-md-offset-3 col-md-9 col-lg-offset-2 col-lg-10' @template.content_tag(:div, class: 'form-group') do @template.content_tag(:div, class: options[:class]) do yield end end end def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block) options[:item_wrapper_class] ||= 'col-sm-offset-3 col-sm-9 col-md-offset-3 col-md-9 col-lg-offset-2 col-lg-10' if block_given? super else super do |input| @template.content_tag(:div, class: 'checkbox') do input.label { input.check_box + input.text } end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simple_form_bootstrap3-0.3.2 | lib/simple_form/horizontal_form_builder.rb |