neocities/views/_flash.erb
2017-04-02 12:25:59 -07:00

15 lines
415 B
Text

<% if @error %>
<div class="alert alert-block alert-error">
<p><%== @error %></p>
</div>
<% end %>
<% if flash.keys.length > 0 %>
<div class="alert alert-block alert-<%= flash.keys.first %> <%= opts[:centered] ? 'txt-Center' : '' %>">
<p>
<% flash.keys.select {|k| [:success, :error, :errors].include?(k)}.each do |key| %>
<%== flash[key] %>
<% end %>
</p>
</div>
<% end %>