Sha256: e3478d071f3d0a5ac0a693c1a1ea49ff033e67188ab55613d479a4754286e73e

Contents?: true

Size: 753 Bytes

Versions: 13

Compression:

Stored size: 753 Bytes

Contents

module FormHelper

  ## Generates verbose bootstrap wrapper HTML for generic forms
  ## Use simple_form_for and it's helpers for forms focused on records
  #
  ## Accepts a hash of arguments with the following keys:
  ## id: id attribute of the input element (necessary for accessible labels)
  ## label: label text
  def input_block(options = {}, &block)
    label_text = options.delete(:label)
    id = options.delete(:id)

    label = if label_text
      label_tag(id, label_text, :class => 'control-label')
    else
      ActiveSupport::SafeBuffer.new # empty safe string
    end

    content_tag(:div, :class => 'control-group') do
      label <<
      content_tag(:div, :class => 'controls') do
        capture(&block)
      end
    end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
iqvoc-4.1.2 app/helpers/form_helper.rb
iqvoc-4.1.1 app/helpers/form_helper.rb
iqvoc-4.1.0 app/helpers/form_helper.rb
iqvoc-4.0.9 app/helpers/form_helper.rb
iqvoc-4.0.8 app/helpers/form_helper.rb
iqvoc-4.0.7 app/helpers/form_helper.rb
iqvoc-4.0.6 app/helpers/form_helper.rb
iqvoc-4.0.5 app/helpers/form_helper.rb
iqvoc-4.0.4 app/helpers/form_helper.rb
iqvoc-4.0.3 app/helpers/form_helper.rb
iqvoc-4.0.2 app/helpers/form_helper.rb
iqvoc-4.0.1 app/helpers/form_helper.rb
iqvoc-4.0.0 app/helpers/form_helper.rb