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