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

25 lines
602 B
Plaintext
Raw Permalink Normal View History

<%= form_for bubble, url: bubble.persisted? ? bubble_path(bubble) : bubbles_path do |f| %>
<div>
<%= f.label :name, "Nom" %>
<%= f.text_field :name, required: true %>
</div>
<div>
<%= f.label :description, "Description" %>
<%= f.text_area :description %>
</div>
<div>
<%= f.label :color, "Couleur" %>
<%= f.color_field :color %>
</div>
<div>
<%= f.label :owner_id, "Administrateur" %>
<%= f.select :owner_id, User.all.collect {|u| [ u.email, u.id ] }, selected: bubble.owner_id || current_user.id %>
</div>
<%= f.submit "Sauvegarder" %>
<% end %>