-
Notifications
You must be signed in to change notification settings - Fork 401
Custom HTML
xrorox edited this page Oct 19, 2011
·
6 revisions
You can custom the html output this way on client_side_validations 3.1.0 :
require 'client_side_validations/simple_form' if defined?(::SimpleForm) require 'client_side_validations/formtastic' if defined?(::Formtastic)
Uncomment the following block if you want each input field to have the validation messages attached.
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| unless html_tag =~ /^<label/ %{
#{html_tag}
#{instance.error_message.first}
#{html_tag}
}.html_safe
end
end
You have to keep
and you must keep the same class for the label and the non-label output. You can change the name of this css class, but both should match as shown here.