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 Person < ActiveRecord::Base | |
has_many :orders | |
has_many :lines, :through => :products | |
has_many :products, :through => :lines | |
end | |
class Order < ActiveRecord::Base | |
has_many :lines | |
has_many :products, :through => :lines | |
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
def class Cart < ActiveRecord::Base | |
#... | |
def installation_instructions_pdf(pdf = nil) | |
pdf ||= Prawn::Document.new | |
eval(IO.read("app/views/cards/installation.pdf.prawn")) | |
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
<span id="update_me">Some text that needs to be updated.</span> | |
<%=link_to_remote "Update", :url => "/update/something", :update => 'update_me' %> | |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'sinatra' | |
require 'haml' | |
require 'gdata' | |
PROJECT_PATH = "/your/project/path" | |
DOMAIN = 'your_google_apps_domain_or_blank_for_any_google_account.com' |
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
# clear a table | |
Given /^I have no (\S+)$/ do |table| | |
ActiveRecord::Base.connection.execute "DELETE FROM `#{table.tableize}`" | |
end | |
# create a new instance, as an @underscore_named_var, and @it. | |
Given /^I have a new (\S+)$/ do |model| | |
eval "@#{model.underscore} = #{model.classify}.new" | |
eval "@it = #{model.classify}.new" | |
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 Core < ActiveResource::Base | |
self.site = case Rails.env | |
when 'production' | |
"http://core.yamatoengines.com" | |
else | |
"http://localhost:3005" | |
end | |
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
#! /usr/bin/ruby | |
require 'rubygems' | |
require 'sinatra' | |
require 'haml' | |
require 'thin' | |
set :public, File.dirname(__FILE__) | |
get '/' do |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'sinatra' | |
require 'haml' | |
require 'gdata' | |
PROJECT_PATH = "/your/project/path" | |
DOMAIN = 'your_google_apps_domain_or_blank_for_any_google_account.com' |
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
//Tango Palette: http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines#Color_Palette | |
//Licensed as Public Domain | |
//LESS'd by James Mason ([email protected]) | |
//Butter | |
@light_butter: #fce94f; | |
@butter: #edd400; | |
@dark_butter: #c4a000; | |
//Orange |
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
#! /usr/bin/ruby | |
# data set: | |
# id | name | score | postal | color | |
# 1 | john | 14 | 12345 | blue | |
# 2 | jane | 10 | 12345 | blue | |
# 3 | jeff | 6 | 12345 | green | |
# define a simple class for holding the dataset |
OlderNewer