I have a view from which I make an ajax request to the controller and after the action is successfully completed I initialize the flash.now[:notice]. But af
code in the controller:
flash[:success] = "All good!" format.html { redirect_to some_path}
and in the view with close button:
<% flash.each do |key, value| %> <%= content_tag(:div, class: "alert alert-#{key} alert-dismissable") do %> <%= value %> × <% end %> <% end %>