<% if @article.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@article.errors.count, "error") %> prohibited this article from being saved:</h2>
<ul>
<% @article.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
_error_messages.html.erb
<%= form_for(@user, url: register_attempt_path, html: { class: 'form-wrapper form-medium' }) do |f| %>
<%= render 'shared/error_messages', object: f.object %>
<%= f.text_field :username, class: 'form-control margin_form_control', placeholder: 'username' %>
<% end %>