在我的应用程序中,我以这种方式向用户显示消息。Ruby on Rails自举警报框
<% flash.each do |key, value| %>
<div class="alert alert-<%= key %> alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<%= value %>
</div>
<% end %>
我有以下线在我的应用程序
.alert-notice {
@extend .alert-warning;
}
当我重定向用户使用redirect_to root_url,:通知=> '邮件' 一切都完美。可以看到通知消息。但是,当我指导用户使用redirect_to root_url,:info =>'messages'时,无法看到任何消息。我调试了代码,并意识到闪存是空的那种情况。
这是确定:
redirect_to root_url, :notice => 'messages'
这里是问题:
redirect_to root_url, :info => 'messages'
有什么建议?
谢谢。
亲爱downvoter,我会感谢我的回答的缺点,所以任何见解我有机会变得更好。 – Gerry