tab/app/views/transactions/new.html.haml
2015-09-10 22:45:38 +02:00

13 lines
646 B
Text

= render 'partials/form_errors', object: @transaction
= form_for @transaction do |f|
- if current_user.penning
= f.collection_select :debtor, User.all, :name, :name,
{ selected: @transaction.debtor.try(:name) || current_user.name }, { class: 'select2-selector'}
- else
= f.hidden_field :debtor, value: current_user.name
= f.collection_select :creditor, User.all, :name, :name,
{ selected: @transaction.creditor.try(:name) || User.zeus.name }, { class: 'select2-selector' }
= f.text_field :message, required: true
= f.number_field :euros, value: @transaction.amount/100
.pure-controls
= f.submit "Send it!"