在轨道上的ruby中的Ajax flash消息
我正在尝试显示一条Flash消息并使用Ajax呈现它,但是在我刷新页面之前 ,消息似乎没有出现。
这是我的create.rjs文件:
page.insert_html :top, :feed_items, :partial => 'shared/feed_item', :object => @micropost page.replace_html :user_info, pluralize(current_user.microposts.count, "micropost") page[:micropost_form].reset page.replace_html :notice, flash[:notice] flash.discard
这是我的应用程序布局视图的相关部分:
<div class="flash ">