count-anything/app/views/count/shared/_form.html.erb

18 lines
613 B
Plaintext
Raw Permalink Normal View History

<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 %>