开发者

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) :

HOWTO: Rails show suggestion message if form submitted but value incorrect

How can I get this small message to appear next to the incorrect field?


You can use client_side_validations gem for that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜