mikaelm1 / Blog-App-Buffalo

A blogging app built with Buffalo.
31 stars 13 forks source link

Error printing template helper #12

Open alexeyismirnov opened 1 year ago

alexeyismirnov commented 1 year ago

In every template you have the following snippet for printing error messages:

 <%= if (errors) { %>
  <%= for (key, val) in errors { %>
...
  <% } %>
<% } %>

Would not it be nice to refactor it into a template helper similar to what you did for CSRF token in render.go ?

That would reduce the amount of template code significantly and make it more readable.