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
$('.btn-submit').each(function() { | |
$(this).click(function(e) { | |
e.preventDefault(); | |
console.log($(".annualized_comp_value").val()); | |
}); | |
}); |
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
<%= form_tag charges_path(id: @cart.id) do %> | |
<article> | |
<%= number_to_currency(@cart.total_price) %> | |
</article> | |
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button" | |
data-key="<%= Rails.configuration.stripe[:publishable_key] %>" | |
data-description="One-time Charge" | |
data-amount="<%= @cart.total_price * 100 %>" | |
data-shipping-address="false" |
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 | |
begin |
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 | |
begin |
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
7 class ChargeMailer < ActionMailer::Base | |
6 default :from => "mygmailaddress@gmail.com" | |
5 | |
4 def registration_confirmation(cust) | |
3 @@customer = cust | |
2 mail(:to => "#{cust.email}", :subject => "Your Order Confirmation") | |
1 end | |
0 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 => [:create] | |
def new | |
@cart = Cart.find(params[:id]) | |
end | |
def create | |
begin |
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
// Place all the styles related to the Products controller here. | |
// They will automatically be included in application.css. | |
// You can use Sass (SCSS) here: http://sass-lang.com/ | |
/* TOP BANNER CONTENT - BEGIN */ | |
#transparent-box | |
{ | |
margin-left: auto; | |
margin-right: auto; | |
position: absolute; |
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 | |
begin |
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
.outerdiv | |
{ | |
margin-left: auto; | |
margin-right: auto; | |
margin-top: 40px; | |
width: 800px; | |
height: 150px; | |
background-color: white; | |
opacity: 0.5; | |
border-radius: 5px; |
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
<div class="cart_title">Your Cart</div> | |
<table> | |
<%= render(@cart.line_items) %> | |
<tr class="total_line"> | |
<td colspan="2">Total</td> | |
<td class="total_cell"><%= number_to_currency(@cart.total_price) %></td> | |
</tr> | |
</table> | |
<%= button_to 'Empty cart', @cart, method: :delete, confirm: 'Are you sure?' %> | |
<%= link_to 'Checkout', new_charge_path(id: @cart.id) %> |
OlderNewer