helper

Ruby code posted
created at 25 Aug 21:24

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
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

318 Bytes in 3 ms with coderay