Title / Description
Code module ContactHelper def error_messages_for_attribute(object, attribute) if object.errors.on(attribute) html = '<small class="errors"><ul>' object.errors.on(attribute).each do |message| html += "<li>" + message + "</li>" end html += "</ul></small>" end end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code