I have the following desired html (slim template):
li
label
span
| Password
small.error ERROR MESSAGE
br
= f.password_field :password
I wanna put the error (small.error) within the "span" above.
My solution (so far) is:
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
if instance.error_message.kind_of?(Array)
%(#{html_tag}<small class="error">
#{instance.error_message.join(',')}</small>).html_safe
else
%(#{html_tag}<small class="error">
#{instance.error_message}</small>).html_safe
end
end
But in this fashion the small tag has been placed right under the input tag.
Could I change that target location?