drhenner/ror_ecommerce

View on GitHub
app/views/admin/shopping/checkout/billing_addresses/index.html.erb

Summary

Maintainability
Test Coverage
<h2>Select Billing Address</h2>

<%= form_tag admin_shopping_checkout_billing_addresses_path do %>

  <% @billing_addresses.each_with_index do |billing_address, i| %>
    <% selected = session_admin_order.bill_address_id == billing_address.id %>
    <div  id='select-address-<%= i %>'
          class='panel callout five large-5 columns
                <%= 'address_selected' if selected %>'>
      <%= render partial: '/shared/compact_address', locals: { shopping_address: billing_address } %>
      <%= link_to 'Use', select_address_admin_shopping_checkout_billing_address_path(billing_address), method: 'put' %> |
      <%= link_to 'Edit', new_admin_shopping_checkout_billing_address_path( old_address_id: billing_address.id ) %>
    </div>
  <% end %>
<% end %>

<br />


<p><%= link_to "New Billing Address", new_admin_shopping_checkout_billing_address_path, class: 'button' %></p>