当我返回redirect_to时,Flash消息不会显示

时间:2015-11-08 10:47:58

标签: ruby-on-rails

我有一个奇怪的问题(我还在学习铁路),有铁轨和闪存消息。

我在rails视图中有一个带方法帖子的link_to:

<%= link_to "<i class='fa fa-times'></i>".html_safe, email_post_path(@post.id), method: 'post' %>

在我的控制器中我这样做:

def email_post
  # do nothing
  return redirect_to posts_path, alert: 'test flash'
end

问题所在 这是正常工作(所以它正确地重定向我),但不显示闪光信息(问题不是显示闪光信息,但闪光[:警告]不存在)< / p>

这是我显示flash消息的方式:

<%= binding.pry %> #used for see if the flash is empty or not - and in this case is it!
<% flash.each do |type, message| %>
  <div class="flash-<%= type %>">
    <%= message %>
  </div>
<% end %>

为什么在这种情况下不显示Flash消息?

1 个答案:

答案 0 :(得分:0)

好的问题似乎是

(Warning: profile :android-common not found.)
(Warning: profile :android-user not found.)
SDK platform 15 is not installed.
Please install it from your Android SDK manager.

使用:

sdk-platform API 23, Rev 1

工作得很好......为什么?

相关问题