Previously, I’ve been doing all my active record error feedback in
forums by using ActionView::Base.field_error_proc. However, it is
somewhat inflexible. I’ve also recently started to “get” custom form
builders and am liking them. It really feels like the error wrapping
should go into the form builders in order to obtain the greatest
amount of ease / flexibility.

I tried to do it this way, but it didn’t come out feeling “right”. I
was wondering if anybody else has done this or might have some
suggestions / feedback on what I did.

end
module FormTagHelper
# Creates a standard label for a field.
#
# Options:
# * <tt>:disabled</tt> - If set to true, the user will not be able

to use this input.
# * :hide_errors - If set to false, the label will append
validation errors for the object
# it is a label for
# A hash of standard HTML options for the tag.
def label_tag(for_id, value = nil, options = {})
options.stringify_keys!
if !options.has_key?(‘for’)
options[‘for’] = for_id
end
content_tag(“label”, value, options)
end
end