checkout function
Showing
| ... | ... | @@ -59,6 +59,14 @@ class CardsController < ApplicationController |
| end | ||
| def checkout | ||
| add_breadcrumb "Checkout", url_for(action: 'checkout') | ||
Please
register
or
sign in
to reply
|
||
| @card_infos = Hash.new | ||
| if session[:SHOPPING_CARD_SESSION_NAME] != nil | ||
| @card_infos = session[:SHOPPING_CARD_SESSION_NAME] | ||
| end | ||
| if @card_infos.empty? | ||
| redirect_to cards_path | ||
| end | ||
| end | ||
| def confirm_checkout | ||
| ... | ... | |
| <h1>Cards#checkout</h1> | ||
| <p>Find me in app/views/cards/checkout.html.erb</p> | ||
| <% provide(:title, "Check out") %> | ||
| <div class="body-box"> | ||
| <h2 class="sprite-2"> | ||
| Check out<span class="sprite-2"></span> | ||
| </h2> | ||
| <%= form_tag do %> | ||
| <%= label_tag(:full_name, "Full name:") %> | ||
| <%= text_field_tag :full_name, nil, class: "form-control" %> | ||
| <%= label_tag(:email, "Email:") %> | ||
| <%= text_field_tag :email, nil, class: "form-control" %> | ||
| <%= label_tag(:phone, "Phone:") %> | ||
| <%= text_field_tag :phone, nil, class: "form-control" %> | ||
| <%= label_tag(:address, "Address:") %> | ||
| <%= text_field_tag :address, nil, class: "form-control" %> | ||
| <%= label_tag(:note, "Note:") %> | ||
| <%= text_area_tag :note, nil, class: "form-control", rows: 10, cols: 25 %> | ||
| <%= render partial: 'cards/item_list', locals: { card_infos: @card_infos, can_edit: false } %> | ||
|
||
| <div class="text-center"> | ||
| <%= submit_tag "Check out", class: 'btn btn-primary btn-submit' %> | ||
| </div> | ||
| <% end %> | ||
| </div> | ||