开发者

Ensure 'flash' messages in controller and view files

I am using Ruby on Rails 3.0.9 and I would like to know if I u开发者_运维技巧se this in my controller

flash[:notice] = "The <b>#{@user.name}</b> was successfully created.".html_safe

and then output that flash message in a view file is sure.


Yup that is what you do.

app/views/index.html.erb

<%= flash[:notice] %>
<%= flash[:message] %>

Or whatever the name of your flash is.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜