Skip to content

Instantly share code, notes, and snippets.

$('.btn-submit').each(function() {
$(this).click(function(e) {
e.preventDefault();
console.log($(".annualized_comp_value").val());
});
});
<%= 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"
class ChargesController < ApplicationController
after_filter :destroy_cart, :only => [:show]
def new
@cart = Cart.find(params[:id])
end
def create
begin
class ChargesController < ApplicationController
after_filter :destroy_cart, :only => [:show]
def new
@cart = Cart.find(params[:id])
end
def create
begin
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
~
class ChargesController < ApplicationController
after_filter :destroy_cart, :only => [:create]
def new
@cart = Cart.find(params[:id])
end
def create
begin
// 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;
class ChargesController < ApplicationController
after_filter :destroy_cart, :only => [:show]
def new
@cart = Cart.find(params[:id])
end
def create
begin
@ornerymoose
ornerymoose / mycssfile.css
Created April 17, 2014 07:03
currently the .innerdiv logo_red.png is affected by the opacity set in .outerdiv. How do I remove the opacity on the .innerdiv?
.outerdiv
{
margin-left: auto;
margin-right: auto;
margin-top: 40px;
width: 800px;
height: 150px;
background-color: white;
opacity: 0.5;
border-radius: 5px;
@ornerymoose
ornerymoose / _cart.html.erb
Created April 17, 2014 16:15
cart partial as is in app/views/carts
<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) %>