debt-manager/app/views/spendings/shared/_form.html.erb

20 lines
556 B
Plaintext
Raw Normal View History

<%= form_for spending, url: spending.persisted? ? spending_path(spending) : bubble_spendings_path(bubble) do |f| %>
<div>
<%= f.label :amount, "Valeur" %>
<%= f.number_field :amount, required: true, step: 0.01 %>
</div>
<div>
<%= f.label :description, "Description" %>
<%= f.text_area :description %>
</div>
<div>
<%= f.label :owner_id, "Créateur" %>
<%= f.select :owner_id, User.all.collect {|u| [ u.email, u.id ] }, selected: bubble.owner_id || current_user.id %>
</div>
<%= f.submit "Sauvegarder" %>
<% end %>