I use client_side_validation gem
and have question:
in my client_side_validation.rb
i have
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
unless html_tag =~ /^<label/
%{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe
else
%{<div class="field_with_errors">#{html_tag}</div>}.html_safe
end
end
and in output i have:
<div>
Name:
<br>
<div class="field_with_errors">
<input id="user_username" type="text" size="30" name="user[username]"data-validate="true">
<label class="message" for="user_username">Only letters allowed</label>
</div>
</div>
i don't want use label :
<label class="message" for="user_username">Only letters allowed</label>
how can i get somthing like this:
<div class="message">Only letters allowed</div>
i tried put in my rb file :
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
unless html_tag =~ /^<label/
%{<div class="field_with_errors">#{html_tag}<div class="message">#{instance.error_message.first}</div></div>}.html_safe
else
%{<div class="field_with_errors">#{html_tag}</div>}.html_safe
end
end
and restart server - but in this case i received only empty div with class message
help pls.. how change standart label to Div ?