Ruby on rails 3 使用respond_时如何使用ajax响应刷新通知?

Ruby on rails 3 使用respond_时如何使用ajax响应刷新通知?,ruby-on-rails-3,jquery,notice,Ruby On Rails 3,Jquery,Notice,flash方法仅在页面重新加载后显示消息。。。当我使用:remote=>true时,如何使其显示?如果使用:remote=>true,则实际上是在执行Ajax请求。 在这种情况下,闪光灯将无法工作 你需要的是有一个js函数来模拟flash消息 我通常有:(Mootools,但你可能知道) 每当我使用:remote=>true时,我都会在js视图中使用它 <% flash.discard %> Dashboard.showMessage('Comment added and was s

flash方法仅在页面重新加载后显示消息。。。当我使用:remote=>true时,如何使其显示?

如果使用:remote=>true,则实际上是在执行Ajax请求。 在这种情况下,闪光灯将无法工作

你需要的是有一个js函数来模拟flash消息

我通常有:(Mootools,但你可能知道)

每当我使用:remote=>true时,我都会在js视图中使用它

<% flash.discard %>
Dashboard.showMessage('Comment added and was sent to clients', 'notice');

Dashboard.showMessage('添加评论并发送给客户','通知');
<% flash.discard %>
Dashboard.showMessage('Comment added and was sent to clients', 'notice');