Sha256: 25b8537ea3ddcd8a42e06249b4cf2780c703459b5416d0e4098b4ed04d5a00eb
Contents?: true
Size: 1.3 KB
Versions: 23
Compression:
Stored size: 1.3 KB
Contents
module FlexaFormtasticBootstrap module Inputs module Base module Choices def input_div_wrapping(&block) template.content_tag(:div, choices_wrapping_html_options) do [yield, error_html(:block), hint_html(:block)].join("\n").html_safe end end def choices_wrapping_html_options # TODO Call the Formtastic one explicity and append? { :class => "choices input" } end def choices_group_wrapping(&block) template.content_tag(:ul, template.capture(&block), choices_group_wrapping_html_options ) end def choices_group_wrapping_html_options { :class => "choices-group inputs-list" } end def choice_label(choice) "\n".html_safe + template.content_tag(:span) do # (choice.is_a?(Array) ? choice.first : choice).to_s (choice.is_a?(Array) ? choice.first : choice).to_s end end # This is actually a label in Bootstrap. def legend_html template.content_tag(:label, label_html_options) do render_label? ? label_text : "".html_safe end end def label_html_options super.merge(:for => nil) end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems