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.
精彩评论