<% attributes ||= [] %> <% attributes.select! { |attribute| form.object.errors[attribute].any? } %> <% if form.object.errors[:base].any? || form.object.errors.present? || attributes.any? %> <%= render 'account/shared/alert', color: 'red' do %> <% if form.object.errors[:base].any? || attributes.any? %> <%= form.object.errors[:base].join(' ') %> <% attributes.each do |attribute| %> <%= resource.class.human_attribute_name(attribute) %> <%= resource.errors[attribute].to_sentence %>. <% end %> <% else %> Please correct the errors below. <% end %> <% end %> <% end %>