设计验证失败时不显示错误的messge? [英] Devise not displaying error messge during an authentication failure?
问题描述
我期待着一个闪光的通知时,认证失败的色器件发生。但认证失败中得到什么,只是页面将刷新并保持静止。
我没有改变任何东西。默认安装色器件本身不带有无效身份验证尝试显示Flash误差。我刚安装捏造,创业板tryed到uise它。 Din't甚至改变所生成的code的话。结果
可能是我想如果这是由于一些浏览器的可比性问题。结果
但我得到的其他码的手动闪光介绍其他形式交往工作。
I was expecting a flash notice when authentication failures occurs in devise. But get nothing during a authentication failure, just the page refreshes and remains still.
I didn't change any stuffs. The default devise installation itself is not displaying flash errors with invalid authentication attempt. I just installed devise as a gem a tryed to uise it. Din't even change a word of the code that is generated.
May be I thought if is it due to some browser comparability issues.
But I get other mannually introduced flash messsages else working.
任何建议,什么可能被打破。
Any suggestions as to what may be broken.
我使用的铁轨3.0.1结果
*更新*
I'm using rails 3.0.1
* Update *
我收到故障消息的用户注册(注册),而不是失败签约的消息英寸
关于这一主题的一些googleing透露,报名参加,预计: - 结果
&所述;%= devise_error_messages! %>
但对于其踪影预计其他一些警报消息标签被引用,但没有得到什么是确切的信息的警示标签,我必须使用和wher使用???
I'm getting failure messages for user registration(sign up) but not for failures messages of signing in.
some googleing on this topic revealed that for sign up it expects:-
<%= devise_error_messages! %>
But for sign in it expects some other alert message tag to be referenced, but didn't get the exact info of what is that alert tag which i must use and wher to use ???
请提供一些建议!结果
先谢谢了。
Please provide some suggestions !!!
Thanks in advance.
推荐答案
Atlast一些良好的金额搜索/浏览后,我找到了答案,结果
你必须添加下面的一段code在我们的application.html.erb文件
Atlast after some good amount of searching/browsing I found the answer,
you have to add the following piece of code in our application.html.erb file
<%- flash.each do |name, msg| -%>
<%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
<%- end -%>
添加这个后,我能看到sign_in故障警报消息。)
After adding this I was able to see the sign_in failures alert messages :).
这篇关于设计验证失败时不显示错误的messge?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!