1
在我的rails应用程序中,我使用客户端验证来显示错误消息。我想用我bootstrap.How可以改变我的代码,以便它显示工具提示上显示工具提示此消息.. 眼下的错误消息来自配置/初始化/ client_side_validation.rb用工具提示进行客户端验证,rails
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
请给任何建议。提前致谢。