Skip to content

Instantly share code, notes, and snippets.

As of 8/25/2013, The following steps will create an ecommerce Rails application using the latest stable version of Spree.
1) cd railsprojects
2) rvm use 1.9.3@spree --create
3) gem install rails -v=3.2.14 --no-ri --no-rdoc
4) rails new mystore -d mysql
5) cd mystore
6) Add the following to the Gemfile
gem 'spree', '2.0.4'
<!DOCTYPE html>
<html>
<head>
<title>My Rails App</title>
<%- if protect_against_forgery? -%>
<meta name="authenticity-token" id="authenticity-token" content="<%= form_authenticity_token %>" />
<%- end -%>
<%= javascript_include_tag 'jquery', 'rails' %>
</head>
<body>
# db/migrate/01_add_custom_admin_roles.rb
class AddCustomAdminRoles < ActiveRecord::Migration
@roles = %w[extra]
def self.up
@roles.each do |r|
Role.create(:name => r)
end
end
class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.timestamps
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
## Recoverable
t.string :reset_password_token
@yurifrl
yurifrl / zsh.md
Created July 17, 2014 13:52 — forked from tsabat/zsh.md

installing postgresql 9.3.2 on ubuntu 12.04

$ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.3 postgresql-contrib-9.3

you should succesfully installing postgresql 9.3.2 on your machine.

// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {
// config/environment.js
// This is not for production. But it will get your
// console to stop screaming errors if your messing
// around with ember cli
module.exports = function(environment) {
//lots of stuff
// <Add this chunk>

Products

index of products 25 first

curl -i -H "X-Spree-Token: YOUR_TOKEN_ID" http://0.0.0.0:3000/api/products.json

Show a product

curl -i -H "X-Spree-Token: YOUR_TOKEN_ID" http://0.0.0.0:3000/api/products/706676762.json

Modify a product

curl -i -X PUT -H "X-Spree-Token: YOUR_TOKEN_ID" -d "product[name]=Headphones" http://0.0.0.0:3000/api/products/706676762.json

@yurifrl
yurifrl / about.md
Last active August 29, 2015 14:26 — forked from tiagoamaro/about.md
searchkick-apartment-example-codes