Sha256: 7e04ec9b2afb4103490983461a26da57a78be351d93b2e1607c8ef19ec404902

Contents?: true

Size: 765 Bytes

Versions: 6

Compression:

Stored size: 765 Bytes

Contents

module Optimacms
  module FormsHelper
    def horizontal_simple_form_for(resource, options = {}, &block)
      options[:html] ||= {}

      # class
      options[:html][:class] ||= []
      if options[:html][:class].is_a? Array
        options[:html][:class] << 'form-horizontal'
      else
        options[:html][:class] << ' form-horizontal'
      end
      options[:html][:role] = 'form'


      options[:wrapper] = :horizontal_form
      options[:wrapper_mappings] = {
        check_boxes: :horizontal_radio_and_checkboxes,
        radio_buttons: :horizontal_radio_and_checkboxes,
        file: :horizontal_file_input,
        boolean: :horizontal_boolean
      }
      simple_form_for(resource, options, &block)
    end


  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
optimacms-0.1.15 app/helpers/optimacms/forms_helper.rb
optimacms-0.1.14 app/helpers/optimacms/forms_helper.rb
optimacms-0.1.5 app/helpers/optimacms/forms_helper.rb
optimacms-0.1.3 app/helpers/optimacms/forms_helper.rb
optimacms-0.1.2 app/helpers/optimacms/forms_helper.rb
optimacms-0.1.1 app/helpers/optimacms/forms_helper.rb