<%= form_for spending, url: spending.persisted? ? spending_path(spending) : bubble_spendings_path(bubble) do |f| %>
<%= f.label :amount, "Valeur" %> <%= f.number_field :amount, required: true, step: 0.01 %>
<%= f.label :description, "Description" %> <%= f.text_area :description %>
<%= 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 %>
<%= f.submit "Sauvegarder" %> <% end %>