我正在使用Ruby on Rails 3.0.9,我想知道我是否在我的控制器中使用它
flash[:notice] = "The <b>#{@user.name}</b> was successfully created.".html_safe
然后在视图文件中输出flash
消息是肯定的。
答案 0 :(得分:2)
是的,这就是你所做的。
app/views/index.html.erb
<%= flash[:notice] %>
<%= flash[:message] %>
或者闪光灯的名称是什么。