<%= link_to "Back to all accounts", root_path %>
Transfer Between Accounts
<% if @transfer.errors.present? %>
<% @transfer.errors.full_messages.each do |msg| %>
- <%= msg %>
<% end %>
<% end %>
<%= form_for @transfer do |f| %>
<%= f.label :from_name %>
<%= f.select :from_name, @accounts.map { |a| ["#{a.name} - #{a.balance}", a.name] }, selected: f.object.from_name, include_blank: true %>
<%= f.label :to_name %>
<%= f.select :to_name, @accounts.map { |a| ["#{a.name} - #{a.balance}", a.name] }, selected: f.object.to_name, include_blank: true %>
<%= f.label :amount %>
<%= f.text_field :amount %>
<%= f.submit "Transfer" %>
<% end %>