In my Rails 4.2.0 app I have the following code inside a view template:
<% if flash[:tutorial].present? %>
<% flash.slice(:tutorial) %>
<% end %>
<% flash.each do |name, msg| %>
<div class="flash <%= name %>">
<p>
<%= msg %>
</p>
</div>
<% end %>
It throws an error however:
Undefined method 'slice' for #<ActionDispatch::Flash::FlashHash:0x0818>
Does anyone have an idea what I might be missing or how to get this to work?
<%= flash[:tutorial] %>