Sha256: 88e7780628853d5c6795bef521320b607f1314a783a034e7142774303e12f342
Contents?: true
Size: 862 Bytes
Versions: 9
Compression:
Stored size: 862 Bytes
Contents
module Trestle class Form module Fields class FormControl < Field def render form_group do input_group do field end end end def input_group if @prepend || @append content_tag(:div, class: "input-group") do concat content_tag(:span, @prepend, class: "input-group-addon") if @prepend concat yield concat content_tag(:span, @append, class: "input-group-addon") if @append end else yield end end def defaults super.merge(class: ["form-control"]) end def extract_options! super @prepend = options.delete(:prepend) @append = options.delete(:append) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems