Module: Adminterface::Extensions::FormBuilder

Defined in:
lib/adminterface/extensions/form_builder.rb

Instance Method Summary collapse

Instance Method Details

#field_set_and_list_wrapping(*args, &block) ⇒ Object



11
12
13
14
15
# File 'lib/adminterface/extensions/form_builder.rb', line 11

def field_set_and_list_wrapping(*args, &block)
  # workaround to replace the ol inside the fieldset tag in f.has_many
  fieldset = super
  fieldset.gsub("<ol><div", "<div").gsub("</div></ol>", "</div>").html_safe
end

#semantic_errors(*args) ⇒ Object



4
5
6
7
8
9
# File 'lib/adminterface/extensions/form_builder.rb', line 4

def semantic_errors(*args)
  msgs = super(*args)
  return if @object.errors.blank? || msgs.blank?

  template. :div, msgs, class: form_css_classes[:error]
end