Hi all
How can I show the div only, when the flash message is not initial?
The div:
<div class="ui red mini message error"><%= get_flash(@conn, :error) %></div>
Thanks
Hi all
How can I show the div only, when the flash message is not initial?
The div:
<div class="ui red mini message error"><%= get_flash(@conn, :error) %></div>
Thanks
I have this
<%= if get_flash(@conn, :error) do %>
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<%= get_flash(@conn, :error) %>
</div>
<%= end %>
Or simply hide it with some CSS (only works if div contains no spaces or other markup):
.message.error:empty {
display: none;
}