Sha256: 34c15b83c520ec3db11484becc66576677c51379645de43e8d7bc53440c83edf
Contents?: true
Size: 1.66 KB
Versions: 17
Compression:
Stored size: 1.66 KB
Contents
module SimpleForm module ActionViewExtensions module BootstrapFormHelper def horizontal_form_for(object, *args, &block) options = args.extract_options! options[:wrapper] ||= :horizontal options[:builder] ||= SimpleForm::HorizontalFormBuilder options[:html] ||= {} options[:html][:role] = 'form' options[:html][:class] = [ options[:html][:class], 'form-horizontal' ].compact.join(' ') simple_form_for object, *(args << options), &block end def default_form_for(object, *args, &block) options = args.extract_options! options[:wrapper] ||= :default options[:builder] ||= SimpleForm::DefaultFormBuilder options[:html] ||= {} options[:html][:role] = 'form' simple_form_for object, *(args << options), &block end def compact_form_for(object, *args, &block) options = args.extract_options! options[:wrapper] ||= :default options[:builder] ||= SimpleForm::PlaceholderFormBuilder options[:html] ||= {} options[:html][:role] = 'form' simple_form_for object, *(args << options), &block end def inline_form_for(object, *args, &block) options = args.extract_options! options[:wrapper] ||= :inline options[:builder] ||= SimpleForm::InlineFormBuilder options[:html] ||= {} options[:html][:role] = 'form' options[:html][:class] = [ options[:html][:class], 'form-inline' ].compact.join(' ') simple_form_for object, *(args << options), &block end end end end ActionView::Base.send :include, SimpleForm::ActionViewExtensions::BootstrapFormHelper
Version data entries
17 entries across 17 versions & 1 rubygems