标签:code source end errors ror safe smis html_ lock
= form_error_messages!(@proto)
def form_error_messages!(resource) return ‘‘ if resource.errors.empty? messages = (resource.errors.messages.map do |key, value| (value.map {|e| content_tag(:li, e)}).join end).join html = <<-HTML <div class="alert alert-danger alert-block"> <button type="button" class="close" data-dismiss="alert">x</button> #{messages} </div> HTML html.html_safe end
标签:code source end errors ror safe smis html_ lock
原文地址:https://www.cnblogs.com/znsongshu/p/9739164.html