This file contains hidden or 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
load 'deploy/assets' | |
require 'bundler/capistrano' | |
set :rake, "/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin/rake" | |
set :application, "Cloud Poker Database" | |
set :repository, "ssh://git@50.56.174.223/home/git/cloud_poker_db_source/" | |
set :scm, :git | |
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` | |
set :deploy_to, "/var/www/" |
This file contains hidden or 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
FATAL: No nodes returned from search! | |
*** done: (Job{provision_server} | ProvisionServer | [10, "test098@gmail.com"]) |
This file contains hidden or 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="account-container register"> | |
<div class="content clearfix"> | |
<h1>Create Your Account</h1> | |
<div class="login-fields"> | |
<%= form_for(@subscription) do |f| %> | |
<%= f.hidden_field :stripe_card_token %> | |
<%= text_field_tag :card_number, nil, name: nil, :placeholder => "Card Number" %></br> | |
<%= text_field_tag :card_code, nil, name: nil, :placeholder => "CVV Code" %></br> | |
<h3>Expiration:</h3> |
This file contains hidden or 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 Subscription < ActiveRecord::Base | |
belongs_to :user | |
attr_accessible :user_id, :stripe_card_token | |
def save_with_payment(plan, email) | |
if valid? | |
customer = Stripe::Customer.create(description: 'ta@gmail.com', plan: '1', card: stripe_card_token) | |
self.stripe_customer_token = customer.id | |
save! |
This file contains hidden or 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 Subscription < ActiveRecord::Base | |
belongs_to :user | |
attr_accessible :user_id, :stripe_card_token | |
def save_with_payment | |
if valid? | |
self.stripe_customer_token = customer.id | |
save! | |
end |
This file contains hidden or 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
def create | |
@subscription = Subscription.new(params[:subscription]) | |
@user = User.new(params[:user]) | |
if @user.save | |
redirect_to "http://google.com" | |
# @subscription.update_attributes[:user_id => @user.id] | |
# redirect_to @subscription, :notice => "Thank you for subscribing!" | |
else | |
respond_to do |format| | |
format.html { render action: "new", notice: @user.errors } |
This file contains hidden or 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
subscriptions/new.html.erb | |
<div class="account-container register"> | |
<div class="content clearfix"> | |
<h1>Create Your Account</h1> | |
<div class="login-fields"> | |
<%= form_for(@subscription) do |f| %> | |
<%= f.hidden_field :stripe_card_token %> | |
<% if @subscription.stripe_card_token.present? %> | |
Credit card has been provided. | |
<% else %> |
This file contains hidden or 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
def create | |
@subscription = Subscription.new(params[:subscription]) | |
@user = User.new(params[:user]) | |
if @user.save | |
redirect_to "http://google.com" | |
# @subscription.update_attributes[:user_id => @user.id] | |
# redirect_to @subscription, :notice => "Thank you for subscribing!" | |
else | |
respond_to do |format| | |
format.html { render action: "new", notice: @user.errors } |
This file contains hidden or 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
// This is a manifest file that'll be compiled into application.js, which will include all the files | |
// listed below. | |
// | |
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | |
// | |
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
// the compiled file. | |
// | |
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
This file contains hidden or 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
server.inspect | |
=> "#<Spice::Client:0x0000000640d318 @attrs={\"name\"=>\"amplifyone\", \"chef_type\"=>\"client\", \"public_key\"=>\"-----BEGIN RSA PUBLIC KEY-----\\nMIIBCgKCAQEApTXM3c7kCgEk6zahSKEMaJYALrzL2BPJFVWEgDhG3TilAZZcDcSj\\n6ZXTlEt59sJ8B0HBoJcHHn6Q3WRMtGTA+zFYLxtyMVgc1S9/NDnoSwEmTXgLFG0G\\nvIeYlXijzMh7rvxQjhbM/gMwoeoHkxS36+4/pDUaGQanf8RAltI4ckzKFMlfZv5j\\nIfHjHVVIpWr9TiI0hmE78kg5ix31pawuR9SBykxvVFEKmMnBt0tkcqUd0Z2IpXdJ\\nVi+zT/h6b6vYWIM2RGUVYwkckpbVH5rXXG+OekiF3Uxg0wCvj1sLWyDkpmVceK8m\\nOUC8Dl3y335NFEU99MNo5kapm3B0yIG2NwIDAQAB\\n-----END RSA PUBLIC KEY-----\\n\", \"_rev\"=>\"1-171933e6ae86fc0138445af35cb07578\", \"json_class\"=>\"Chef::ApiClient\", \"admin\"=>false}>" | |
1.9.3-p0 :021 > |