Skip to content

Instantly share code, notes, and snippets.

class CartController < ApplicationController
def add
id = params[:id]
if session[:cart] then # if a cart has already been created, use it, otherwise make a new one
cart = session[:cart]
else
session[:cart] = {}
cart = session[:cart]
end
class CartController < ApplicationController
def add
id = params[:id]
if session[:cart] then # if a cart has already been created, use it, otherwise make a new one
cart = session[:cart]
else
session[:cart] = {}
cart = session[:cart]
end
package shapes;
import java.awt.Graphics;
import java.awt.Color;
/**
* @author - Jeong Min Kim u0264416
* @version - 3/14/2017
* @pre_condition you need 6 int values
* @post_condition you get back an object that is initially 200 pixels in width and 100 in height. It will move on a timer