Small layout adjustments and form errors in partial outsourced
This commit is contained in:
18
app/views/layouts/_form_errors.html.erb
Normal file
18
app/views/layouts/_form_errors.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<% if model.errors.any? %>
|
||||
<div class="p-4 bg-red-50 border border-red-200 rounded-xl flex gap-3 text-sm text-red-800 shadow-sm animate-fade-in">
|
||||
<!-- Heroicon: exclamation-triangle -->
|
||||
<svg class="h-5 w-5 text-red-600 shrink-0 mt-0.5" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" />
|
||||
</svg>
|
||||
<div>
|
||||
<h4 class="font-bold">
|
||||
<%= model.class.model_name.human %> konnte nicht gespeichert werden
|
||||
</h4>
|
||||
<ul class="list-disc list-inside mt-1 space-y-0.5 text-xs text-red-700">
|
||||
<% model.errors.full_messages.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user