tab/app/views/transactions/new.html.haml

14 lines
665 B
Text
Raw Normal View History

2015-09-09 17:06:39 +02:00
= render 'partials/form_errors', object: @transaction
2015-09-09 11:24:45 +02:00
= simple_form_for @transaction do |f|
2015-09-09 15:31:23 +02:00
- if current_user.penning
= f.collection_select :debtor, User.all, :name, :name,
{ selected: @transaction.debtor.try(:name) || current_user.name }, { class: 'select2-selector'}
2015-09-09 15:31:23 +02:00
- 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' }
2015-09-09 11:24:45 +02:00
= f.input :message, required: true
2015-09-09 17:39:17 +02:00
= f.input :euros, input_html: { value: @transaction.amount/100}
2015-09-09 17:06:39 +02:00
.pure-controls
= f.button :submit, "Send it!"