Sha256: 6c9b02aed499abf441647258f87eb920d67499b63582ac8c34ef39759603ffba

Contents?: true

Size: 788 Bytes

Versions: 2

Compression:

Stored size: 788 Bytes

Contents

<p><%= link_to "Back to all accounts", root_path %></p>

<h1>Transfer Between Accounts</h1>


<% if @transfer.errors.present? %>
  <ul>
    <% @transfer.errors.full_messages.each do |msg| %>
      <li><%= msg %></li>
    <% end %>
  </ul>
<% end %>

<%= form_for @transfer do |f| %>
  <div>
    <%= f.label :from_name %><br />
    <%= f.select :from_name, @accounts.map { |a| ["#{a.name} - #{a.balance}", a.name] }, selected: f.object.from_name, include_blank: true %>
  </div>
  <div>
    <%= f.label :to_name %><br />
    <%= f.select :to_name, @accounts.map { |a| ["#{a.name} - #{a.balance}", a.name] }, selected: f.object.to_name, include_blank: true %>
  </div>
  <div>
    <%= f.label :amount %><br />
    <%= f.text_field :amount %>
  </div>
  <%= f.submit "Transfer" %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
command_model-2.1.1 examples/bank/app/views/transfers/new.html.erb
command_model-2.1.0 examples/bank/app/views/transfers/new.html.erb