lib/mir_extensions.rb
def required_field_helper( model, element, html )
      if model && ! model.errors.empty? && element.is_required
        return content_tag( :div, html, :class => 'fieldWithErrors' )
      else
        return html
      end
    end
def required_field_helper( model, element, html )
      if model && ! model.errors.empty? && element.is_required
        return content_tag( :div, html, :class => 'fieldWithErrors' )
      else
        return html
      end
    end
Wraps the given HTML in Rails' default style to highlight validation errors, if any.