Ich arbeite an meiner Erstellung einer Beispiel-App aus Rails Tutorial von Michael Hartl. Ich arbeitete an den Fehlern auf meiner Anmeldeseite und stieß auf ein Problem, das ich nicht lösen konnte.Anmeldung Seite Fehlermeldung in Ruby auf Schienen
Hier nach den 5 aufgeführten Fehlermeldungen Theres eine unerwünschte Array die gleichen Fehlermeldungen auflistet.
Hier ist der HTML
<%= provide(:title, 'Sign up') %>
<h1>Sign Up</h1>
<div class = "row">
<div class = "col-md-6 col-md-offset-3">
<%= form_for(@user) do |f| %>
<%= render 'shared/error_messages' %>
<%= f.label :name %>
<%= f.text_field :name, class: 'form-control' %>
<%= f.label :email %>
<%= f.text_field :email, class: 'form-control' %>
<%= f.label :password %>
<%= f.password_field :password, class: 'form-control' %>
<%= f.label :password_confirmation, "Confirmation"%>
<%= f.password_field :password_confirmation, class: 'form-control' %>
<%= f.submit "Create My Account", class: "btn btn-primary" %>
<% end %>
</div>
Und hier ist die Fehlermeldung Teil:
<% if @user.errors.any? %>
<div id="error_explaination">
<div class="alert alert-danger">
The form contains <%= pluralize(@user.errors.count, "error")%>
</div>
<ul>
<%= @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
Und SCSS Datei:
/* FORMS */
input, textarea, select, .uneditable-input{
border: 1px solid #bbb;
width: 100%;
margin-bottom: 15px;
@include box_sizing;
}
input{
height: auto !important;
}
#error_explaination{
color: red;
ul{
color: red;
margin: 0 0 30px 0;
}
}
.field_with_errors{
@extend .has-error;
.form-control{
color: $state-danger-text;
}
}
Helfen Sie mir. Danke