HOWTO: Rails show suggestion message if form submitted but value incorrect
开发者_运维知识库<div class="field">
<%= f.label :name %><br/>
<span style="color:red;font-weight: normal; font-size:11px; "><%= errors_for(:name, @user) %> </span>
<%= f.text_field :name, :class => "login", :placeholder => "Your Name" %>
</div>
I have an input like the above and I need the below to happen if the form is submitted but the value entered is wrong (e.g no @ sign in the email or the password does not match the verification) :
How can I get this small message to appear next to the incorrect field?
You can use client_side_validations
gem for that.
精彩评论