This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
respond_to do |format| | |
CustomerMailer.registration_confirmation(@customer.email).deliver | |
format.html { redirect_to charge_path(@cart, {customer_id: @customer.id}) } | |
format.json { head :ok } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChargesController < ApplicationController | |
after_filter :destroy_cart, :only => [:show] | |
def new | |
@cart = Cart.find(params[:id]) | |
end | |
def create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<%= stylesheet_link_tag "products-index" %> | |
</head> | |
<body> | |
<div class="wrapper-index"> | |
<div class="push-index"></div> | |
<div class="products-container"> | |
<% @products.each_with_index do |product, index| %> | |
<div class="product-item-<%= index %>"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<%= stylesheet_link_tag "products-index" %> | |
</head> | |
<body> | |
<div class="wrapper-index"> | |
<div class="push-index"></div> | |
<div class="products-container"> | |
<% @products.each_with_index do |product, index| %> | |
<div class="product-item-<%= index %>"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductsController < ApplicationController | |
before_action :set_product, only: [:show] | |
# GET /products | |
# GET /products.json | |
def index | |
@products = Product.all | |
@cart = current_cart | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<%= stylesheet_link_tag "charges-new" %> | |
</head> | |
<body> | |
<%= form_tag charges_path(id: @cart.id) do %> | |
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button" | |
data-key="<%= Rails.configuration.stripe[:publishable_key] %>" | |
data-description="One-time Charge" | |
data-name="MyCompany" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<%= stylesheet_link_tag "customer-cart" %> | |
</head> | |
<body> | |
<div class="wrapper-customer-cart"> | |
<div class="push-customer-cart"></div> | |
<div class="customer-cart-container"> | |
<div class="cart_title">Shopping Cart</div> | |
<table id="checkout-table"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PATH=$HOME/usr/local/bin:$PATH | |
# export PATH | |
export CC=/usr/bin/gcc-4.2 | |
export PATH=$PATH:/Android/android-sdk-mac_x86/tools | |
# {{{ | |
# Node Completion - Auto-generated, do not touch. | |
shopt -s progcomp | |
for f in $(command ls ~/.node-completion); do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body id="customer-cart"> | |
<div class="wrapper-customer-cart"> | |
<div class="push-customer-cart"></div> | |
<div class="customer-cart-container"> | |
<div id="cart-title">Cart</div> | |
<div class="line"><hr /></div> | |
<div class="empty-cart"></div> | |
<table id="checkout-table"> | |
<tr style="font-weight: bold;" class="cart-table-header"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @cart.line_items.each do |item| %> | |
<tr><td><%= item.product.name %></td> | |
<td><%= item.size %></td> | |
<td><%= item.color %></td> | |
<td><%= item.quantity %></td> | |
<td><%= link_to 'Delete', | |
{ :controller => 'line_items', :action => 'destroy', :id => item.id }, | |
{ :method => :delete, :remote => true, :class => 'delete-item'} %> </td> | |
<td>$<%= item.product.price %></td></tr> | |
<% end %> |