For some reason my :alert
does not work, whereas :notice
works just fine.
<% if notice %>
<p id="notice" ><%= notice %></p>
<% elseif alert %>
<p id="alert" ><%= alert %></p>
<% end %>
<%= yield %>
Anyone know why :alert
is not working? I'm using Rails 3.1.0.RC5
<%- flash.each do |k, v| %>
<div id="<%= k %>"><%= v %></div>
<% end %>
<%= yield %>
To make sure you display all flash messages:
<%- flash.each do |k, v| %>
<div id="<%= k %>"><%= v %></div>
Are these for flash? If so, do they work when explicitly calling flash?
<% if flash[:notice] %>
<p id="notice" ><%= flash[:notice] %></p>
<% elsif flash[:alert] %>
<p id="alert" ><%= flash[:alert] %></p>
<% end %>
<%= yield %>
If not, it could be an issue in your controller. Please post the code that is setting the :notice and :alerts.
精彩评论