Track incomes
This commit is contained in:
parent
ab00344de0
commit
e098ab48ca
19 changed files with 337 additions and 1 deletions
42
app/views/incomes/_form.html.erb
Normal file
42
app/views/incomes/_form.html.erb
Normal file
|
@ -0,0 +1,42 @@
|
|||
<%= form_with(model: income, class: "contents") do |form| %>
|
||||
<% if income.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(income.errors.count, "error") %> prohibited this income from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% income.errors.each do |error| %>
|
||||
<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 :included %>
|
||||
<%= form.check_box :included, class: "block mt-2 h-5 w-5" %>
|
||||
</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="my-5">
|
||||
<%= form.label :member_id %>
|
||||
<%=
|
||||
form.select :member_id,
|
||||
options_for_select(members, income.member_id),
|
||||
{},
|
||||
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 %>
|
Loading…
Add table
Add a link
Reference in a new issue