From 1fa549d3a11c6c47894e09a555fd437c9ff10eec Mon Sep 17 00:00:00 2001 From: f Date: Sat, 27 Jun 2020 21:42:32 -0300 Subject: [PATCH] mostrar un resumen de los errores --- app/views/posts/_form.haml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index 3d325292..ef9f51a4 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -3,6 +3,19 @@ %h4= t('.errors.title') %p= t('.errors.help') + %ul + - post.errors.each do |attribute, errors| + - if errors.size > 1 + %li + %strong= post_label_t attribute, post: post + %ul + - errors.each do |error| + %li= error + - else + %li + %strong= post_label_t attribute, post: post + = errors.first + -# TODO: habilitar form_for :ruby if post.new?