It’s basically a messaging system that flashes messages for a few seconds on page loads.
In the controller, you usually load the flash messages like this:
flash[:success] = “Welcome to the Sample App!”
And in the views (usually a designated place in the layout view), you can display it as:
<% flash.each do |key, value| %>
<div class=”alert alert-<%= key %>”><%= value %></div>
<% end %>
Flash messages are stored in the session, and are cleared at the next request time.
You can combine redirect and flash messages as follows:
redirect_to @project, notice: "Project has been created."