count-anything/app/views/count/shared/_form.html.erb
Louis Vallat d07857c011
feat: added counts and instant update and destroy
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
2023-02-05 21:01:07 +01:00

18 lines
613 B
Plaintext

<div class="mt-2 mb-4">
<%= form_for @count, url: @count.id ? count_path : count_index_path, class: "row" do |f| %>
<div class="col-2">
<%= f.label :name, t("fields.name") %>
<%= f.text_field :name, class: "form-control" %>
</div>
<div class="col-2 mt-2 mb-2">
<%= f.label :count, t("fields.count") %>
<%= f.number_field :count, class: "form-control" %>
</div>
<%= f.submit t("fields.save"), class: "btn btn-primary" %>
<% end %>
</div>
<% if @count.id %>
<%= button_to "", count_path(@count), method: :delete, class: "bi-trash-fill btn btn-danger" %>
<% end %>