# Add the following in your layout
<%= zui "toast/wrapper" do %>
<%= zui_flash_to_toast %>
<% end %>
# In the controller action, set flash messages as follows
# and they will be rendered as toast messages automatically
flash[:notice] = "Post was successfully created."
flash[:alert] = "Post was not created."
flash[:info] = "Post is being created."
flash[:warning] = "You are close to exceeding your limit of posts"
flash[:alert] = {title: "Error!", description: "Post was not created as you have reached your plan limit"}