budget/app/views/credit_card_bills/_form.html.erb

27 lines
1 KiB
Text
Raw Permalink Normal View History

2023-03-03 18:12:59 -05:00
<%= form_with(model: credit_card_bill, class: "contents") do |form| %>
<% if credit_card_bill.errors.any? %> <div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3">
<h2><%= pluralize(credit_card_bill.errors.count, "error") %> prohibited this credit_card_bill from being saved:</h2>
2023-02-24 19:08:12 -05:00
<ul>
2023-03-03 18:12:59 -05:00
<% credit_card_bill.errors.each do |error| %>
2023-02-24 19:08:12 -05:00
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="my-5">
<%= form.label :description %>
<%= form.text_field :description, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
<%= form.label :amount %>
<%= form.text_field :amount, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
</div>
<div class="inline">
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
</div>
<% end %>