The Depot Application
Table of Contents
Development Log
rails -v
Rails 2.3.1
ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
gem -v
1.3.1
rails depot
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
ln -s ~/git/rails vendor/rails
cp -rp ../plugins/* vendor/plugins/
ls vendor/plugins/
acts_as_list
acts_as_tree
annotate_models
MANIFEST
edit config/environments/development.rb
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
config.logger = Logger.new(config.log_path, 2, 10.kilobytes)
4 Instant Gratification
erb -r rubygems -r active_support -T - < ../../code/erb/ex1.html.erb |
sed "s/<!--.*-->//"
<ul>
<li>Addition: 3 </li>
<li>Concatenation: cowboy </li>
<li>Time in one hour: Mon Mar 09 17:28:19 -0400 2009 </li>
</ul>
erb -r rubygems -r active_support -T - < ../../code/erb/ex2.html.erb |
sed "s/<!--.*-->//" | tee ../../code/erb/ex2.op
Ho!<br />
Ho!<br />
Ho!<br />
Merry Christmas!
erb -r rubygems -r active_support -T - < ../../code/erb/ex2a.html.erb |
sed "s/<!--.*-->//" | tee ../../code/erb/ex2a.op
Ho!<br />
Ho!<br />
Ho!<br />
Merry Christmas!
sed "s/-%>\n/%>/" < ../../code/erb/ex2b.html.erb |
erb -r rubygems -r active_support -T - |
sed "s/<!--.*-->//" | tee ../../code/erb/ex2b.op
Ho!<br />
Ho!<br />
Ho!<br />
Merry Christmas!
6.2 Iteration A1: Get Something Running
ls -p
app/
config/
db/
doc/
lib/
log/
public/
Rakefile
README
script/
test/
tmp/
vendor/
ruby script/generate scaffold product title:string description:text image_url:string
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/products
exists app/views/layouts/
exists test/functional/
exists test/unit/
create test/unit/helpers/
exists public/stylesheets/
create app/views/products/index.html.erb
create app/views/products/show.html.erb
create app/views/products/new.html.erb
create app/views/products/edit.html.erb
create app/views/layouts/products.html.erb
create public/stylesheets/scaffold.css
create app/controllers/products_controller.rb
create test/functional/products_controller_test.rb
create app/helpers/products_helper.rb
create test/unit/helpers/products_helper_test.rb
route map.resources :products
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/product.rb
create test/unit/product_test.rb
create test/fixtures/products.yml
create db/migrate
create db/migrate/20090309202821_create_products.rb
rake db:migrate
mv 20090309202821_create_products.rb 20080601000001_create_products.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateProducts: migrating =================================================
-- create_table(:products)
-> 0.0133s
== CreateProducts: migrated (0.0134s) ========================================
sqlite3> select version from schema_migrations
version = 20080601000001
edit app/views/products/new.html.erb
<h1>New product</h1>
<% form_for(@product) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :description %><br />
<%= f.text_area :description, :rows => 6 %>
</p>
<p>
<%= f.label :image_url %><br />
<%= f.text_field :image_url %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
<%= link_to 'Back', products_path %>
get /products
Listing products
Title
Description
Image url
New product
get /products/new
post /products
product[image_url] => /images/svn.jpg
product[description] => <p>
This book is a recipe-based approach to
using Subversion that will get you up
and running quickly---and correctly. All
projects need version control: it's a
foundational piece of any project's
infrastructure. Yet half of all project
teams in the U.S. dont use any version
control at all. Many others dont use it
well, and end up experiencing
time-consuming problems.
</p>
product[title] => Pragmatic Version Control
You are being
redirected .
get http://127.0.0.1:3000/products/1
Title:
Pragmatic Version Control
Description:
<p>
This book is a recipe-based approach to
using Subversion that will get you up
and running quickly---and correctly. All
projects need version control: it's a
foundational piece of any project's
infrastructure. Yet half of all project
teams in the U.S. dont use any version
control at all. Many others dont use it
well, and end up experiencing
time-consuming problems.
</p>
Image url:
/images/svn.jpg
Edit |
Back
get /products
Listing products
Title
Description
Image url
Pragmatic Version Control
<p>
This book is a recipe-based approach to
using Subversion that will get you up
and running quickly---and correctly. All
projects need version control: it's a
foundational piece of any project's
infrastructure. Yet half of all project
teams in the U.S. dont use any version
control at all. Many others dont use it
well, and end up experiencing
time-consuming problems.
</p>
/images/svn.jpg
Show
Edit
Destroy
New product
sqlite3 db/development.sqlite3 .schema
CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "description" text, "image_url" varchar(255), "created_at" datetime, "updated_at" datetime);
CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL);
CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version");
rake test
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/unit/helpers/products_helper_test.rb" "test/unit/product_test.rb"
(in /home/rubys/svn/RAILS3/Book/util/depot)
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
.
Finished in 0.040638 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/functional/products_controller_test.rb"
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
.......
Finished in 0.111642 seconds.
7 tests, 10 assertions, 0 failures, 0 errors
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb"
6.3 Iteration A2: Add a Missing Column
ruby script/generate migration add_price_to_product price:decimal
exists db/migrate
create db/migrate/20090309202828_add_price_to_product.rb
cat db/migrate/20090309202828_add_price_to_product.rb
class AddPriceToProduct < ActiveRecord::Migration
def self.up
add_column :products, :price, :decimal
end
def self.down
remove_column :products, :price
end
end
edit db/migrate/20090309202828_add_price_to_product.rb
class AddPriceToProduct < ActiveRecord::Migration
def self.up
add_column :products, :price, :decimal,
:precision => 8, :scale => 2, :default => 0
end
def self.down
remove_column :products, :price
end
end
rake db:migrate
mv 20090309202828_add_price_to_product.rb 20080601000002_add_price_to_product.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== AddPriceToProduct: migrating ==============================================
-- add_column(:products, :price, :decimal, {:precision=>8, :scale=>2, :default=>0})
-> 0.0383s
== AddPriceToProduct: migrated (0.0384s) =====================================
sqlite3 db/development.sqlite3 .schema
CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "description" text, "image_url" varchar(255), "created_at" datetime, "updated_at" datetime, "price" decimal(8,2) DEFAULT 0);
CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL);
CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version");
edit app/views/products/index.html.erb
<h1>Listing products</h1>
<table>
<tr>
<th>Title</th>
<th>Description</th>
<th>Image url</th>
<th>Price</th>
</tr>
<% @products.each do |product| %>
<tr>
<td><%=h product.title %></td>
<td><%=h product.description %></td>
<td><%=h product.image_url %></td>
<td><%=h product.price %></td>
<td><%= link_to 'Show', product %></td>
<td><%= link_to 'Edit', edit_product_path(product) %></td>
<td><%= link_to 'Destroy', product, :confirm => 'Are you sure?',
:method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New product', new_product_path %>
edit app/views/products/new.html.erb
<h1>New product</h1>
<% form_for(@product) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :description %><br />
<%= f.text_area :description, :rows => 6 %>
</p>
<p>
<%= f.label :image_url %><br />
<%= f.text_field :image_url %>
</p>
<p>
<%= f.label :price %><br />
<%= f.text_field :price %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
<%= link_to 'Back', products_path %>
edit app/views/products/edit.html.erb
<h1>Editing product</h1>
<% form_for(@product) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :description %><br />
<%= f.text_area :description %>
</p>
<p>
<%= f.label :image_url %><br />
<%= f.text_field :image_url %>
</p>
<p>
<%= f.label :price %><br />
<%= f.text_field :price %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
<%= link_to 'Show', @product %> |
<%= link_to 'Back', products_path %>
edit app/views/products/show.html.erb
<p>
<b>Title:</b>
<%=h @product.title %>
</p>
<p>
<b>Description:</b>
<%=h @product.description %>
</p>
<p>
<b>Image url:</b>
<%=h @product.image_url %>
</p>
<p>
<b>Price:</b>
<%=h @product.price %>
</p>
<%= link_to 'Edit', edit_product_path(@product) %> |
<%= link_to 'Back', products_path %>
get /products
Listing products
Title
Description
Image url
Price
Pragmatic Version Control
<p>
This book is a recipe-based approach to
using Subversion that will get you up
and running quickly---and correctly. All
projects need version control: it's a
foundational piece of any project's
infrastructure. Yet half of all project
teams in the U.S. dont use any version
control at all. Many others dont use it
well, and end up experiencing
time-consuming problems.
</p>
/images/svn.jpg
0.0
Show
Edit
Destroy
New product
get /products/1
Title:
Pragmatic Version Control
Description:
<p>
This book is a recipe-based approach to
using Subversion that will get you up
and running quickly---and correctly. All
projects need version control: it's a
foundational piece of any project's
infrastructure. Yet half of all project
teams in the U.S. dont use any version
control at all. Many others dont use it
well, and end up experiencing
time-consuming problems.
</p>
Image url:
/images/svn.jpg
Price:
0.0
Edit |
Back
get /products/new
rake test
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/unit/helpers/products_helper_test.rb" "test/unit/product_test.rb"
(in /home/rubys/svn/RAILS3/Book/util/depot)
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
.
Finished in 0.045747 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/functional/products_controller_test.rb"
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
.......
Finished in 0.120961 seconds.
7 tests, 10 assertions, 0 failures, 0 errors
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb"
edit app/views/products/show.html.erb
<p>
<b>Title:</b>
<%=h @product.title %>
</p>
<p>
<b>Description:</b>
<%= @product.description %>
</p>
<p>
<b>Image url:</b>
<%=h @product.image_url %>
</p>
<p>
<b>Price:</b>
<%=h @product.price %>
</p>
<%= link_to 'Edit', edit_product_path(@product) %> |
<%= link_to 'Back', products_path %>
get /products/1
Title:
Pragmatic Version Control
Description:
This book is a recipe-based approach to
using Subversion that will get you up
and running quickly---and correctly. All
projects need version control: it's a
foundational piece of any project's
infrastructure. Yet half of all project
teams in the U.S. dont use any version
control at all. Many others dont use it
well, and end up experiencing
time-consuming problems.
Image url:
/images/svn.jpg
Price:
0.0
Edit |
Back
6.4 Iteration A3: Validate!
edit app/models/product.rb
class Product < ActiveRecord::Base
validates_presence_of :title, :description, :image_url
validates_numericality_of :price
validate :price_must_be_at_least_a_cent
validates_uniqueness_of :title
validates_format_of :image_url, :allow_blank => true,
:with => %r{\.(gif|jpg|png)$}i,
:message => 'must be a URL for GIF, JPG ' +
'or PNG image.'
protected
def price_must_be_at_least_a_cent
errors.add(:price, 'should be at least 0.01') if price.nil? ||
price < 0.00
end
end
get /products/new
post /products
New product
3 errors prohibited this product from being saved There were problems with the following fields:
Image url can't be blank Title can't be blank Description can't be blank
Title
Description
Image url
Price
Back
get /products/new
post /products
product[image_url] => /images/utj.jpg
product[price] => wibble
product[description] => A true masterwork. Comparable to Kafka at
his funniest, or Marx during his slapstick
period. Move over, Tolstoy, there's a new
funster in town.
product[title] => Pragmatic Unit Testing
edit app/models/product.rb
class Product < ActiveRecord::Base
validates_presence_of :title, :description, :image_url
validates_numericality_of :price
validate :price_must_be_at_least_a_cent
validates_uniqueness_of :title
validates_format_of :image_url,
:with => %r{\.(gif|jpg|png)$}i,
:message => 'must be a URL for GIF, JPG ' +
'or PNG image.'
protected
def price_must_be_at_least_a_cent
errors.add(:price, 'should be at least 0.01') if price.nil? ||
price < 0.01
end
end
edit app/views/layouts/products.html.erb
6.5 Iteration A4: Prettier Listings
edit db/migrate/003_add_test_data.rb
class AddTestData < ActiveRecord::Migration
def self.up
Product.delete_all
Product.create(:title => 'Pragmatic Version Control',
:description =>
%{<p>
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
</p>},
:image_url => '/images/svn.jpg',
:price => 28.50)
# . . .
end
def self.down
Product.delete_all
end
end
rake db:migrate
mv 003_add_test_data.rb 20080601000003_add_test_data.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== AddTestData: migrating ====================================================
== AddTestData: migrated (0.0755s) ===========================================
edit app/views/layouts/products.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Products: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold', 'depot' %>
</head>
edit app/views/products/index.html.erb
<div id="product-list">
<h1>Listing products</h1>
<table>
<% for product in @products %>
<tr class="<%= cycle('list-line-odd', 'list-line-even') %>">
<td>
<%= image_tag product.image_url, :class => 'list-image' %>
</td>
<td class="list-description">
<dl>
<dt><%=h product.title %></dt>
<dd><%=h truncate(product.description.gsub(/<.*?>/,''),
:length => 80) %></dd>
</dl>
</td>
<td class="list-actions">
<%= link_to 'Show', product %><br/>
<%= link_to 'Edit', edit_product_path(product) %><br/>
<%= link_to 'Destroy', product,
:confirm => 'Are you sure?',
:method => :delete %>
</td>
</tr>
<% end %>
</table>
</div>
<br />
<%= link_to 'New product', new_product_path %>
cp -v /home/rubys/svn/RAILS3/Book/util/data/images/* public/images/
`/home/rubys/svn/RAILS3/Book/util/data/images/auto.jpg' -> `public/images/auto.jpg'
`/home/rubys/svn/RAILS3/Book/util/data/images/logo.png' -> `public/images/logo.png'
`/home/rubys/svn/RAILS3/Book/util/data/images/rails.png' -> `public/images/rails.png'
`/home/rubys/svn/RAILS3/Book/util/data/images/svn.jpg' -> `public/images/svn.jpg'
`/home/rubys/svn/RAILS3/Book/util/data/images/utc.jpg' -> `public/images/utc.jpg'
cp -v /home/rubys/svn/RAILS3/Book/util/data/depot.css public/stylesheets
`/home/rubys/svn/RAILS3/Book/util/data/depot.css' -> `public/stylesheets/depot.css'
get /products
rake test
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/unit/helpers/products_helper_test.rb" "test/unit/product_test.rb"
(in /home/rubys/svn/RAILS3/Book/util/depot)
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
.
Finished in 0.041168 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/functional/products_controller_test.rb"
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
F.....F
Finished in 0.134422 seconds.
1) Failure:
test_should_create_product(ProductsControllerTest) [/test/functional/products_controller_test.rb:16]:
"Product.count" didn't change by 1.
<3> expected but was
<2>.
2) Failure:
test_should_update_product(ProductsControllerTest) [/test/functional/products_controller_test.rb:35]:
Expected response to be a <:redirect>, but was <200>
7 tests, 9 assertions, 2 failures, 0 errors
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb"
Errors running test:functionals!
7.1 Iteration B1: Create the Catalog Listing
ruby script/generate controller store index
exists app/controllers/
exists app/helpers/
create app/views/store
exists test/functional/
exists test/unit/helpers/
create app/controllers/store_controller.rb
create test/functional/store_controller_test.rb
create app/helpers/store_helper.rb
create test/unit/helpers/store_helper_test.rb
create app/views/store/index.html.erb
restart
get /store
Store#index
Find me in app/views/store/index.html.erb
edit app/controllers/store_controller.rb
class StoreController < ApplicationController
def index
@products = Product.find_products_for_sale
end
end
edit app/models/product.rb
class Product < ActiveRecord::Base
def self.find_products_for_sale
find(:all, :order => "title")
end
# validation stuff...
validates_presence_of :title, :description, :image_url
validates_numericality_of :price
validate :price_must_be_at_least_a_cent
validates_uniqueness_of :title
validates_format_of :image_url,
:with => %r{\.(gif|jpg|png)$}i,
:message => 'must be a URL for GIF, JPG ' +
'or PNG image.'
protected
def price_must_be_at_least_a_cent
errors.add(:price, 'should be at least 0.01') if price.nil? ||
price < 0.01
end
end
edit app/views/store/index.html.erb
<h1>Your Pragmatic Catalog</h1>
<% for product in @products -%>
<div class="entry">
<%= image_tag(product.image_url) %>
<h3><%=h product.title %></h3>
<%= product.description %>
<div class="price-line">
<span class="price"><%= product.price %></span>
</div>
</div>
<% end %>
get /store
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
29.95
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
27.75
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
28.5
7.2 Iteration B2: Add a Page Layout
edit app/views/layouts/store.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Pragprog Books Online Store</title>
<%= stylesheet_link_tag "depot", :media => "all" %><!-- <label id="code.slt"/> -->
</head>
<body id="store">
<div id="banner">
<%= image_tag("logo.png") %>
<%= @page_title || "Pragmatic Bookshelf" %><!-- <label id="code.depot.e.title"/> -->
</div>
<div id="columns">
<div id="side">
<a href="http://www....">Home</a><br />
<a href="http://www..../faq">Questions</a><br />
<a href="http://www..../news">News</a><br />
<a href="http://www..../contact">Contact</a><br />
</div>
<div id="main">
<%= yield :layout %><!-- <label id="code.depot.e.include"/> -->
</div>
</div>
</body>
</html>
edit public/stylesheets/depot.css
/* Styles for main page */
#banner {
background: #9c9;
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 2px solid;
font: small-caps 40px/40px "Times New Roman", serif;
color: #282;
text-align: center;
}
#banner img {
float: left;
}
#columns {
background: #141;
}
#main {
margin-left: 13em;
padding-top: 4ex;
padding-left: 2em;
background: white;
}
#side {
float: left;
padding-top: 1em;
padding-left: 1em;
padding-bottom: 1em;
width: 12em;
background: #141;
}
#side a {
color: #bfb;
font-size: small;
}
get /store
Pragmatic Bookshelf
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
29.95
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
27.75
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
28.5
7.3 Iteration B3: Use a Helper to Format the Price
edit app/views/store/index.html.erb
<h1>Your Pragmatic Catalog</h1>
<% for product in @products -%>
<div class="entry">
<%= image_tag(product.image_url) %>
<h3><%=h product.title %></h3>
<%= product.description %>
<div class="price-line">
<span class="price"><%= number_to_currency(product.price) %></span>
</div>
</div>
<% end %>
get /store
Pragmatic Bookshelf
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
$29.95
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
$27.75
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
$28.50
7.4 Iteration B4: Linking to the Cart
edit app/views/store/index.html.erb
<%= button_to "Add to Cart" %>
edit public/stylesheets/depot.css
#store .entry form, #store .entry form div {
display: inline;
}
get /store
Pragmatic Bookshelf
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
8.1 Sessions
rake db:sessions:create
(in /home/rubys/svn/RAILS3/Book/util/depot)
exists db/migrate
create db/migrate/20090309202853_create_sessions.rb
rake db:migrate
mv 20090309202853_create_sessions.rb 20080601000004_create_sessions.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateSessions: migrating =================================================
-- create_table(:sessions)
-> 0.0112s
-- add_index(:sessions, :session_id)
-> 0.0142s
-- add_index(:sessions, :updated_at)
-> 0.0172s
== CreateSessions: migrated (0.0429s) ========================================
sqlite3 db/development.sqlite3 .schema
CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "description" text, "image_url" varchar(255), "created_at" datetime, "updated_at" datetime, "price" decimal(8,2) DEFAULT 0);
CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL);
CREATE TABLE "sessions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "session_id" varchar(255) NOT NULL, "data" text, "created_at" datetime, "updated_at" datetime);
CREATE INDEX "index_sessions_on_session_id" ON "sessions" ("session_id");
CREATE INDEX "index_sessions_on_updated_at" ON "sessions" ("updated_at");
CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version");
edit config/initializers/session_store.rb
# Be sure to restart your server when you modify this file.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
ActionController::Base.session = {
:key => '_depot_session',
:secret => 'ee7e02c54ec896e262b6e4af0aec6b1e874e806b7a48a8ec003aae596ca6d663c577f61e51656d0337aac53478269cdaaa6bf5da70f5aa6a6a81c82710bf53ff'
}
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
ActionController::Base.session_store = :active_record_store
restart
edit app/controllers/application_controller.rb
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
end
edit app/controllers/store_controller.rb
private
def find_cart
session[:cart] ||= Cart.new
end
8.2 Iteration C1: Creating a Cart
edit app/models/cart.rb
class Cart
attr_reader :items # <wtf linkend="wtf.attr.accessor">attr_reader</wtf>
def initialize
@items = []
end
def add_product(product)
@items << product
end
end
edit app/models/cart_item.rb
class CartItem
attr_reader :product, :quantity
def initialize(product)
@product = product
@quantity = 1
end
def increment_quantity
@quantity += 1
end
def title
@product.title
end
def price
@product.price * @quantity
end
end
edit app/views/store/index.html.erb
<%= button_to "Add to Cart", :action => 'add_to_cart', :id => product %>
edit app/controllers/store_controller.rb
def add_to_cart
product = Product.find(params[:id]) # <label id="code.depot.f.find"/>
@cart = find_cart # <label id="code.depot.f.find2"/>
@cart.add_product(product) # <label id="code.depot.f.add"/>
end
get /store/add_to_cart/2
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>Template is missing</h1>
<p>Missing template store/add_to_cart.erb in view path app/views</p>
</body>
</html>
edit app/views/store/add_to_cart.html.erb
<h2>Your Pragmatic Cart</h2>
<ul>
<% for item in @cart.items %>
<li><%=h item.title %></li>
<% end %>
</ul>
get /store/add_to_cart/2
Pragmatic Bookshelf
Your Pragmatic Cart
Pragmatic Project Automation
Pragmatic Project Automation
get /store/add_to_cart/3
Pragmatic Bookshelf
Your Pragmatic Cart
Pragmatic Project Automation
Pragmatic Project Automation
Pragmatic Version Control
8.3 Iteration C2: A Smarter Cart
edit app/models/cart_item.rb
class CartItem
attr_reader :product, :quantity
def initialize(product)
@product = product
@quantity = 1
end
def increment_quantity
@quantity += 1
end
def title
@product.title
end
def price
@product.price * @quantity
end
end
class CartItem
attr_reader :product, :quantity
def initialize(product)
@product = product
@quantity = 1
end
def increment_quantity
@quantity += 1
end
def title
@product.title
end
def price
@product.price * @quantity
end
end
edit app/models/cart.rb
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
@items << CartItem.new(product)
end
end
edit app/views/store/add_to_cart.html.erb
<h2>Your Pragmatic Cart</h2>
<ul>
<% for item in @cart.items %>
<li><%= item.quantity %> × <%=h item.title %></li>
<% end %>
</ul>
get /store/add_to_cart/2
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#add_to_cart
</h1>
<p>
Showing <i>app/views/store/add_to_cart.html.erb</i> where line <b>#4</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb8075a2e8></code></pre>
</p>
<p>Extracted source (around line <b>#4</b>):
<pre><code>1: <h2>Your Pragmatic Cart</h2>
2: <ul>
3: <% for item in @cart.items %>
4: <li><%= item.quantity %> &times; <%=h item.title %></li>
5: <% end %>
6: </ul>
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{"id"=>"2"}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
rake db:sessions:clear
(in /home/rubys/svn/RAILS3/Book/util/depot)
get /store/add_to_cart/2
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#add_to_cart
</h1>
<p>
Showing <i>app/views/store/add_to_cart.html.erb</i> where line <b>#4</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb80435c20></code></pre>
</p>
<p>Extracted source (around line <b>#4</b>):
<pre><code>1: <h2>Your Pragmatic Cart</h2>
2: <ul>
3: <% for item in @cart.items %>
4: <li><%= item.quantity %> &times; <%=h item.title %></li>
5: <% end %>
6: </ul>
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{"id"=>"2"}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /store/add_to_cart/2
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#add_to_cart
</h1>
<p>
Showing <i>app/views/store/add_to_cart.html.erb</i> where line <b>#4</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb805bad70></code></pre>
</p>
<p>Extracted source (around line <b>#4</b>):
<pre><code>1: <h2>Your Pragmatic Cart</h2>
2: <ul>
3: <% for item in @cart.items %>
4: <li><%= item.quantity %> &times; <%=h item.title %></li>
5: <% end %>
6: </ul>
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{"id"=>"2"}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /store/add_to_cart/3
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#add_to_cart
</h1>
<p>
Showing <i>app/views/store/add_to_cart.html.erb</i> where line <b>#4</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb807681e0></code></pre>
</p>
<p>Extracted source (around line <b>#4</b>):
<pre><code>1: <h2>Your Pragmatic Cart</h2>
2: <ul>
3: <% for item in @cart.items %>
4: <li><%= item.quantity %> &times; <%=h item.title %></li>
5: <% end %>
6: </ul>
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:4:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{"id"=>"3"}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /store/add_to_cart/wibble
ActiveRecord::RecordNotFound
in StoreController#add_to_cart
Couldn't find Product with ID=wibble
RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot
Application Trace |
Framework Trace |
Full Trace
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:1595:in `find_one'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:1578:in `find_from_ids'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:616:in `find'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/store_controller.rb:11:in `add_to_cart'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:1595:in `find_one'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:1578:in `find_from_ids'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:616:in `find'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/store_controller.rb:11:in `add_to_cart'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:1595:in `find_one'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:1578:in `find_from_ids'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/base.rb:616:in `find'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/store_controller.rb:11:in `add_to_cart'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275
Request
Parameters :
{"id"=>"wibble"}
Show session dump
Response
Headers :
{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}
8.4 Iteration C3: Handling Errors
edit app/controllers/store_controller.rb
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@cart.add_product(product)
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid product #{params[:id]}")
flash[:notice] = "Invalid product"
redirect_to :action => 'index'
end
get /store/add_to_cart/wibble
You are being
redirected .
get http://127.0.0.1:3000/store
Pragmatic Bookshelf
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
tail -17 log/development.log
# Logfile created on Mon Mar 09 16:29:07 -0400 2009 by /
Attempt to access invalid product wibble
Redirected to http://127.0.0.1:3000/store
Completed in 9ms (DB: 0) | 302 Found [http://127.0.0.1/store/add_to_cart/wibble]
Processing StoreController#index (for 127.0.0.1 at 2009-03-09 16:29:07) [GET]
*[4;35;1mProduct Load (0.8ms)*[0m *[0mSELECT * FROM "products" ORDER BY title*[0m
Rendering template within layouts/store
Rendering store/index
Completed in 22ms (View: 16, DB: 1) | 200 OK [http://127.0.0.1/store]
edit app/views/layouts/store.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Pragprog Books Online Store</title>
<%= stylesheet_link_tag "depot", :media => "all" %>
</head>
<body id="store">
<div id="banner">
<%= image_tag("logo.png") %>
<%= @page_title || "Pragmatic Bookshelf" %>
</div>
<div id="columns">
<div id="side">
<a href="http://www....">Home</a><br />
<a href="http://www..../faq">Questions</a><br />
<a href="http://www..../news">News</a><br />
<a href="http://www..../contact">Contact</a><br />
</div>
<div id="main">
<% if flash[:notice] -%>
<div id="notice"><%= flash[:notice] %></div>
<% end -%>
<%= yield :layout %>
</div>
</div>
</body>
</html>
edit public/stylesheets/depot.css
#notice {
border: 2px solid red;
padding: 1em;
margin-bottom: 2em;
background-color: #f0f0f0;
font: bold smaller sans-serif;
}
get /store/add_to_cart/wibble
You are being
redirected .
get http://127.0.0.1:3000/store
Pragmatic Bookshelf
Invalid product
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
8.5 Iteration C4: Finishing the Cart
edit app/views/store/add_to_cart.html.erb
<h2>Your Pragmatic Cart</h2>
<ul>
<% for item in @cart.items %>
<li><%= item.quantity %> × <%=h item.title %></li>
<% end %>
</ul>
<%= button_to 'Empty cart', :action => 'empty_cart' %>
edit app/controllers/store_controller.rb
def empty_cart
session[:cart] = nil
flash[:notice] = "Your cart is currently empty"
redirect_to :action => 'index'
end
get /store/empty_cart
You are being
redirected .
get http://127.0.0.1:3000/store
Pragmatic Bookshelf
Your cart is currently empty
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
edit app/controllers/store_controller.rb
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@cart.add_product(product)
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid product #{params[:id]}")
redirect_to_index("Invalid product")
end
def empty_cart
session[:cart] = nil
redirect_to_index("Your cart is currently empty")
end
private
def redirect_to_index(msg)
flash[:notice] = msg
redirect_to :action => 'index'
end
edit app/views/store/add_to_cart.html.erb
<div class="cart-title">Your Cart</div>
<table>
<% for item in @cart.items %>
<tr>
<td><%= item.quantity %>×</td>
<td><%=h item.title %></td>
<td class="item-price"><%= number_to_currency(item.price) %></td>
</tr>
<% end %>
<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", :action => :empty_cart %>
edit public/stylesheets/depot.css
/* Styles for the cart in the main page */
.cart-title {
font: 120% bold;
}
.item-price, .total-line {
text-align: right;
}
.total-line .total-cell {
font-weight: bold;
border-top: 1px solid #595;
}
edit app/models/cart.rb
class Cart
attr_reader :items # <wtf linkend="wtf.attr.accessor">attr_reader</wtf>
def initialize
@items = []
end
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
@items << CartItem.new(product)
end
end
def total_price
@items.sum { |item| item.price }
end
end
get /store/add_to_cart/2
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#add_to_cart
</h1>
<p>
Showing <i>app/views/store/add_to_cart.html.erb</i> where line <b>#5</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb805cf3d8></code></pre>
</p>
<p>Extracted source (around line <b>#5</b>):
<pre><code>2: <table>
3: <% for item in @cart.items %>
4: <tr>
5: <td><%= item.quantity %>&times;</td>
6: <td><%=h item.title %></td>
7: <td class="item-price"><%= number_to_currency(item.price) %></td>
8: </tr>
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{"id"=>"2"}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /store/add_to_cart/2
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#add_to_cart
</h1>
<p>
Showing <i>app/views/store/add_to_cart.html.erb</i> where line <b>#5</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb80748160></code></pre>
</p>
<p>Extracted source (around line <b>#5</b>):
<pre><code>2: <table>
3: <% for item in @cart.items %>
4: <tr>
5: <td><%= item.quantity %>&times;</td>
6: <td><%=h item.title %></td>
7: <td class="item-price"><%= number_to_currency(item.price) %></td>
8: </tr>
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{"id"=>"2"}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /store/add_to_cart/3
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#add_to_cart
</h1>
<p>
Showing <i>app/views/store/add_to_cart.html.erb</i> where line <b>#5</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb8042f6b8></code></pre>
</p>
<p>Extracted source (around line <b>#5</b>):
<pre><code>2: <table>
3: <% for item in @cart.items %>
4: <tr>
5: <td><%= item.quantity %>&times;</td>
6: <td><%=h item.title %></td>
7: <td class="item-price"><%= number_to_currency(item.price) %></td>
8: </tr>
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:5:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/add_to_cart.html.erb:3:in `_run_erb_app47views47store47add_to_cart46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:329:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{"id"=>"3"}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
9.1 Iteration D1: Moving the Cart
edit app/views/store/add_to_cart.html.erb
<div class="cart-title">Your Cart</div>
<table>
<%= render(:partial => "cart_item", :collection => @cart.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", :action => :empty_cart %>
edit app/views/store/_cart_item.html.erb
<tr>
<td><%= cart_item.quantity %>×</td>
<td><%=h cart_item.title %></td>
<td class="item-price"><%= number_to_currency(cart_item.price) %></td>
</tr>
cp app/views/store/add_to_cart.html.erb app/views/store/_cart.html.erb
edit app/views/store/_cart.html.erb
<div class="cart-title">Your Cart</div>
<table>
<%= render(:partial => "cart_item", :collection => cart.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", :action => :empty_cart %>
edit app/views/layouts/store.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Pragprog Books Online Store</title>
<%= stylesheet_link_tag "depot", :media => "all" %>
</head>
<body id="store">
<div id="banner">
<%= image_tag("logo.png") %>
<%= @page_title || "Pragmatic Bookshelf" %>
</div>
<div id="columns">
<div id="side">
<div id="cart">
<%= render(:partial => "cart", :object => @cart) %>
</div>
<a href="http://www....">Home</a><br />
<a href="http://www..../faq">Questions</a><br />
<a href="http://www..../news">News</a><br />
<a href="http://www..../contact">Contact</a><br />
</div>
<div id="main">
<% if flash[:notice] -%>
<div id="notice"><%= flash[:notice] %></div>
<% end -%>
<%= yield :layout %>
</div>
</div>
</body>
</html>
edit app/controllers/store_controller.rb
def index
@products = Product.find_products_for_sale
@cart = find_cart
end
edit public/stylesheets/depot.css
/* Styles for the cart in the sidebar */
#cart, #cart table {
font-size: smaller;
color: white;
}
#cart table {
border-top: 1px dotted #595;
border-bottom: 1px dotted #595;
margin-bottom: 10px;
}
get /store
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#index
</h1>
<p>
Showing <i>app/views/store/_cart_item.html.erb</i> where line <b>#2</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb805bd700></code></pre>
</p>
<p>Extracted source (around line <b>#2</b>):
<pre><code>1: <tr>
2: <td><%= cart_item.quantity %>&times;</td>
3: <td><%=h cart_item.title %></td>
4: <td class="item-price"><%= number_to_currency(cart_item.price) %></td>
5: </tr>
</code></pre></p>
<p>Trace of template inclusion: app/views/store/_cart.html.erb, app/views/layouts/store.html.erb</p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:2:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:19:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:2:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:19:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:2:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:19:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
edit app/controllers/store_controller.rb
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@cart.add_product(product)
redirect_to_index
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid product #{params[:id]}")
redirect_to_index("Invalid product")
end
edit app/controllers/store_controller.rb
def redirect_to_index(msg = nil)
flash[:notice] = msg if msg
redirect_to :action => 'index'
end
rm app/views/store/add_to_cart.html.erb
get /store/add_to_cart/3
You are being
redirected .
get http://127.0.0.1:3000/store
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#index
</h1>
<p>
Showing <i>app/views/store/_cart_item.html.erb</i> where line <b>#2</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb8058ab98></code></pre>
</p>
<p>Extracted source (around line <b>#2</b>):
<pre><code>1: <tr>
2: <td><%= cart_item.quantity %>&times;</td>
3: <td><%=h cart_item.title %></td>
4: <td class="item-price"><%= number_to_currency(cart_item.price) %></td>
5: </tr>
</code></pre></p>
<p>Trace of template inclusion: app/views/store/_cart.html.erb, app/views/layouts/store.html.erb</p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:2:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:19:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:2:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:19:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:2:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:19:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
9.2 Iteration D2: An AJAX-Based Cart
edit app/views/store/index.html.erb
<% form_remote_tag :url => { :action => 'add_to_cart', :id => product } do %>
<%= submit_tag "Add to Cart" %>
<% end %>
edit app/views/layouts/store.html.erb
<html>
<head>
<title>Pragprog Books Online Store</title>
<%= stylesheet_link_tag "depot", :media => "all" %>
<%= javascript_include_tag :defaults %>
</head>
edit app/controllers/store_controller.rb
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@cart.add_product(product)
respond_to do |format|
format.js
end
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid product #{params[:id]}")
redirect_to_index("Invalid product")
end
edit app/views/store/add_to_cart.js.rjs
page.replace_html("cart", :partial => "cart", :object => @cart)
9.3 Iteration D3: Highlighting Changes
edit app/models/cart.rb
class Cart
attr_reader :items # <wtf linkend="wtf.attr.accessor">attr_reader</wtf>
def initialize
@items = []
end
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
current_item = CartItem.new(product)
@items << current_item
end
current_item
end
def total_price
@items.sum { |item| item.price }
end
end
edit app/controllers/store_controller.rb
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@current_item = @cart.add_product(product)
respond_to do |format|
format.js
end
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid product #{params[:id]}")
redirect_to_index("Invalid product")
end
edit app/views/store/_cart_item.html.erb
<% if cart_item == @current_item %>
<tr id="current_item">
<% else %>
<tr>
<% end %>
<td><%= cart_item.quantity %>×</td>
<td><%=h cart_item.title %></td>
<td class="item-price"><%= number_to_currency(cart_item.price) %></td>
</tr>
edit app/views/store/add_to_cart.js.rjs
page.replace_html("cart", :partial => "cart", :object => @cart)
page[:current_item].visual_effect :highlight,
:startcolor => "#88ff88",
:endcolor => "#114411"
9.4 Iteration D4: Hide an Empty Cart
edit app/views/store/add_to_cart.js.rjs
page.replace_html("cart", :partial => "cart", :object => @cart)
page[:cart].visual_effect :blind_down if @cart.total_items == 1
page[:current_item].visual_effect :highlight,
:startcolor => "#88ff88",
:endcolor => "#114411"
edit app/models/cart.rb
class Cart
attr_reader :items # <wtf linkend="wtf.attr.accessor">attr_reader</wtf>
def initialize
@items = []
end
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
current_item = CartItem.new(product)
@items << current_item
end
current_item
end
def total_price
@items.sum { |item| item.price }
end
def total_items
@items.sum { |item| item.quantity }
end
end
ls -p app
controllers/
helpers/
models/
views/
ls -p app/helpers
application_helper.rb
products_helper.rb
store_helper.rb
edit app/views/layouts/store.html.erb
<% hidden_div_if(@cart.items.empty?, :id => "cart") do %>
<%= render(:partial => "cart", :object => @cart) %>
<% end %>
edit app/helpers/store_helper.rb
module StoreHelper
def hidden_div_if(condition, attributes = {}, &block)
if condition
attributes["style"] = "display: none"
end
content_tag("div", attributes, &block)
end
end
edit app/controllers/store_controller.rb
def empty_cart
session[:cart] = nil
redirect_to_index
end
9.5 Iteration D5: Degrading If Javascript Is Disabled
edit app/controllers/store_controller.rb
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@current_item = @cart.add_product(product)
respond_to do |format|
format.js if request.xhr?
format.html {redirect_to_index}
end
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid product #{params[:id]}")
redirect_to_index("Invalid product")
end
get /store/empty_cart
You are being
redirected .
get http://127.0.0.1:3000/store
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#index
</h1>
<p>
Showing <i>app/views/store/_cart.html.erb</i> where line <b>#7</b> raised:
<pre><code>undefined method `total_price' for #<Cart:0x7fdb8056c5a8 @items=[]></code></pre>
</p>
<p>Extracted source (around line <b>#7</b>):
<pre><code>4:
5: <tr class="total-line">
6: <td colspan="2">Total</td>
7: <td class="total-cell"><%= number_to_currency(cart.total_price) %></td>
8: </tr>
9:
10: </table>
</code></pre></p>
<p>Trace of template inclusion: app/views/layouts/store.html.erb</p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:7:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:7:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:7:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /store/add_to_cart/3
You are being
redirected .
get http://127.0.0.1:3000/store
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#index
</h1>
<p>
Showing <i>app/views/store/_cart_item.html.erb</i> where line <b>#8</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb8053c268></code></pre>
</p>
<p>Extracted source (around line <b>#8</b>):
<pre><code>5: <tr>
6: <% end %>
7: <!-- #END_HIGHLIGHT -->
8: <td><%= cart_item.quantity %>&times;</td>
9: <td><%=h cart_item.title %></td>
10: <td class="item-price"><%= number_to_currency(cart_item.price) %></td>
11: </tr>
</code></pre></p>
<p>Trace of template inclusion: app/views/store/_cart.html.erb, app/views/layouts/store.html.erb</p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
10.1 Iteration E1: Capturing an Order
ruby script/generate scaffold order name:string address:text email:string pay_type:string
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/orders
exists app/views/layouts/
exists test/functional/
exists test/unit/
exists test/unit/helpers/
exists public/stylesheets/
create app/views/orders/index.html.erb
create app/views/orders/show.html.erb
create app/views/orders/new.html.erb
create app/views/orders/edit.html.erb
create app/views/layouts/orders.html.erb
identical public/stylesheets/scaffold.css
create app/controllers/orders_controller.rb
create test/functional/orders_controller_test.rb
create app/helpers/orders_helper.rb
create test/unit/helpers/orders_helper_test.rb
route map.resources :orders
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/order.rb
create test/unit/order_test.rb
create test/fixtures/orders.yml
exists db/migrate
create db/migrate/20090309202912_create_orders.rb
ruby script/generate scaffold line_item product_id:integer order_id:integer quantity:integer total_price:decimal
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/line_items
exists app/views/layouts/
exists test/functional/
exists test/unit/
exists test/unit/helpers/
exists public/stylesheets/
create app/views/line_items/index.html.erb
create app/views/line_items/show.html.erb
create app/views/line_items/new.html.erb
create app/views/line_items/edit.html.erb
create app/views/layouts/line_items.html.erb
identical public/stylesheets/scaffold.css
create app/controllers/line_items_controller.rb
create test/functional/line_items_controller_test.rb
create app/helpers/line_items_helper.rb
create test/unit/helpers/line_items_helper_test.rb
route map.resources :line_items
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/line_item.rb
create test/unit/line_item_test.rb
create test/fixtures/line_items.yml
exists db/migrate
create db/migrate/20090309202913_create_line_items.rb
edit db/migrate/20090309202912_create_orders.rb
def self.up
create_table :orders do |t|
t.string :name
t.text :address
t.string :email
t.string :pay_type, :limit => 10
t.timestamps
end
end
edit db/migrate/20090309202913_create_line_items.rb
class CreateLineItems < ActiveRecord::Migration
def self.up
create_table :line_items do |t|
t.integer :product_id, :null => false, :options =>
"CONSTRAINT fk_line_item_products REFERENCES products(id)"
t.integer :order_id, :null => false, :options =>
"CONSTRAINT fk_line_item_orders REFERENCES orders(id)"
t.integer :quantity, :null => false
t.decimal :total_price, :null => false, :precision => 8, :scale => 2
t.timestamps
end
end
def self.down
drop_table :line_items
end
end
rake db:migrate
mv 20090309202912_create_orders.rb 20080601000005_create_orders.rb
mv 20090309202913_create_line_items.rb 20080601000006_create_line_items.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateOrders: migrating ===================================================
-- create_table(:orders)
-> 0.0241s
== CreateOrders: migrated (0.0242s) ==========================================
== CreateLineItems: migrating ================================================
-- create_table(:line_items)
-> 0.0120s
== CreateLineItems: migrated (0.0121s) =======================================
sqlite3 db/development.sqlite3 .schema
CREATE TABLE "line_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_id" integer NOT NULL, "order_id" integer NOT NULL, "quantity" integer NOT NULL, "total_price" decimal(8,2) NOT NULL, "created_at" datetime, "updated_at" datetime);
CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "address" text, "email" varchar(255), "pay_type" varchar(10), "created_at" datetime, "updated_at" datetime);
CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "description" text, "image_url" varchar(255), "created_at" datetime, "updated_at" datetime, "price" decimal(8,2) DEFAULT 0);
CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL);
CREATE TABLE "sessions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "session_id" varchar(255) NOT NULL, "data" text, "created_at" datetime, "updated_at" datetime);
CREATE INDEX "index_sessions_on_session_id" ON "sessions" ("session_id");
CREATE INDEX "index_sessions_on_updated_at" ON "sessions" ("updated_at");
CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version");
edit app/models/order.rb
class Order < ActiveRecord::Base
has_many :line_items
end
edit app/models/product.rb
class Product < ActiveRecord::Base
has_many :line_items
# ...
edit app/models/line_item.rb
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
end
edit app/views/store/_cart.html.erb
<div class="cart-title">Your Cart</div>
<table>
<%= render(:partial => "cart_item", :collection => cart.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 "Checkout", :action => 'checkout' %>
<%= button_to "Empty cart", :action => :empty_cart %>
edit app/controllers/store_controller.rb
def checkout
@cart = find_cart
if @cart.items.empty?
redirect_to_index("Your cart is empty")
else
@order = Order.new
end
end
edit app/views/store/checkout.html.erb
<div class="depot-form">
<%= error_messages_for 'order' %>
<% form_for :order, :url => { :action => :save_order } do |form| %>
<fieldset>
<legend>Please Enter Your Details</legend>
<div>
<%= form.label :name, "Name:" %>
<%= form.text_field :name, :size => 40 %>
</div>
<div>
<%= form.label :address, "Address:" %>
<%= form.text_area :address, :rows => 3, :cols => 40 %>
</div>
<div>
<%= form.label :email, "E-Mail:" %>
<%= form.text_field :email, :size => 40 %>
</div>
<div>
<%= form.label :pay_type, "Pay with:" %>
<%=
form.select :pay_type,
Order::PAYMENT_TYPES,
:prompt => "Select a payment method"
%>
</div>
<%= submit_tag "Place Order", :class => "submit" %>
</fieldset>
<% end %>
</div>
edit app/models/order.rb
class Order < ActiveRecord::Base
PAYMENT_TYPES = [
# Displayed stored in db
[ "Check", "check" ],
[ "Credit card", "cc" ],
[ "Purchase order", "po" ]
]
# ...
edit public/stylesheets/depot.css
/* Styles for order form */
.depot-form fieldset {
background: #efe;
}
.depot-form legend {
color: #dfd;
background: #141;
font-family: sans-serif;
padding: 0.2em 1em;
}
.depot-form label {
width: 5em;
float: left;
text-align: right;
padding-top: 0.2em;
margin-right: 0.1em;
display: block;
}
.depot-form select, .depot-form textarea, .depot-form input {
margin-left: 0.5em;
}
.depot-form .submit {
margin-left: 4em;
}
.depot-form div {
margin: 0.5em 0;
}
get /store/checkout
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#checkout
</h1>
<p>
Showing <i>app/views/store/_cart_item.html.erb</i> where line <b>#8</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb8044c880></code></pre>
</p>
<p>Extracted source (around line <b>#8</b>):
<pre><code>5: <tr>
6: <% end %>
7: <!-- #END_HIGHLIGHT -->
8: <td><%= cart_item.quantity %>&times;</td>
9: <td><%=h cart_item.title %></td>
10: <td class="item-price"><%= number_to_currency(cart_item.price) %></td>
11: </tr>
</code></pre></p>
<p>Trace of template inclusion: app/views/store/_cart.html.erb, app/views/layouts/store.html.erb</p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /store/save_order
Unknown action
No action responded to save_order. Actions: add_to_cart, checkout, empty_cart, and index
edit app/models/order.rb
class Order < ActiveRecord::Base
PAYMENT_TYPES = [
# Displayed stored in db
[ "Check", "check" ],
[ "Credit card", "cc" ],
[ "Purchase order", "po" ]
]
validates_presence_of :name, :address, :email, :pay_type
validates_inclusion_of :pay_type, :in =>
PAYMENT_TYPES.map {|disp, value| value}
# ...
edit app/controllers/store_controller.rb
def save_order
@cart = find_cart
@order = Order.new(params[:order]) # <label id="code.p.new.order"/>
@order.add_line_items_from_cart(@cart) # <label id="code.p.append.li"/>
if @order.save # <label id="code.p.save"/>
session[:cart] = nil
redirect_to_index("Thank you for your order")
else
render :action => 'checkout'
end
end
edit app/models/order.rb
class Order < ActiveRecord::Base
PAYMENT_TYPES = [
# Displayed stored in db
[ "Check", "check" ],
[ "Credit card", "cc" ],
[ "Purchase order", "po" ]
]
# ...
validates_presence_of :name, :address, :email, :pay_type
validates_inclusion_of :pay_type, :in =>
PAYMENT_TYPES.map {|disp, value| value}
# ...
has_many :line_items
def add_line_items_from_cart(cart)
cart.items.each do |item|
li = LineItem.from_cart_item(item)
line_items << li
end
end
end
edit app/models/line_item.rb
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
end
sqlite3> select * from orders
sqlite3> select * from line_items
get /store/save_order
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError
in StoreController#save_order
</h1>
<pre>undefined method `product' for #<Product:0x7fdb803138b0></pre>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/line_item.rb:9:in `from_cart_item'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:32:in `add_line_items_from_cart'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:31:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:31:in `add_line_items_from_cart'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/store_controller.rb:45:in `save_order'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/line_item.rb:9:in `from_cart_item'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:32:in `add_line_items_from_cart'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:31:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:31:in `add_line_items_from_cart'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/store_controller.rb:45:in `save_order'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/line_item.rb:9:in `from_cart_item'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:32:in `add_line_items_from_cart'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:31:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/app/models/order.rb:31:in `add_line_items_from_cart'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/store_controller.rb:45:in `save_order'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /store/checkout
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Store#checkout
</h1>
<p>
Showing <i>app/views/store/_cart_item.html.erb</i> where line <b>#8</b> raised:
<pre><code>undefined method `quantity' for #<Product:0x7fdb80468508></code></pre>
</p>
<p>Extracted source (around line <b>#8</b>):
<pre><code>5: <tr>
6: <% end %>
7: <!-- #END_HIGHLIGHT -->
8: <td><%= cart_item.quantity %>&times;</td>
9: <td><%=h cart_item.title %></td>
10: <td class="item-price"><%= number_to_currency(cart_item.price) %></td>
11: </tr>
</code></pre></p>
<p>Trace of template inclusion: app/views/store/_cart.html.erb, app/views/layouts/store.html.erb</p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:260:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart_item.html.erb:8:in `_run_erb_app47views47store47_cart_item46html46erb_locals_cart_item_cart_item_counter_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:221:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `map'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:216:in `render_partial_collection'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:182:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/store/_cart.html.erb:3:in `_run_erb_app47views47store47_cart46html46erb_locals_cart_object'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:20:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in `benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:19:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable_partial.rb:44:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/partials.rb:184:in `render_partial'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:25:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:36:in `capture'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb:70:in `content_tag'
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers/store_helper.rb:6:in `hidden_div_if'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:332:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
sqlite3> select * from orders
sqlite3> select * from line_items
edit app/views/store/add_to_cart.js.rjs
page.select("div#notice").each { |div| div.hide }
page.replace_html("cart", :partial => "cart", :object => @cart)
page[:cart].visual_effect :blind_down if @cart.total_items == 1
page[:current_item].visual_effect :highlight,
:startcolor => "#88ff88",
:endcolor => "#114411"
11.1 Iteration F1: Adding Users
ruby script/generate scaffold user name:string hashed_password:string salt:string
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/users
exists app/views/layouts/
exists test/functional/
exists test/unit/
exists test/unit/helpers/
exists public/stylesheets/
create app/views/users/index.html.erb
create app/views/users/show.html.erb
create app/views/users/new.html.erb
create app/views/users/edit.html.erb
create app/views/layouts/users.html.erb
identical public/stylesheets/scaffold.css
create app/controllers/users_controller.rb
create test/functional/users_controller_test.rb
create app/helpers/users_helper.rb
create test/unit/helpers/users_helper_test.rb
route map.resources :users
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/user.rb
create test/unit/user_test.rb
create test/fixtures/users.yml
exists db/migrate
create db/migrate/20090309202916_create_users.rb
restart
cat db/migrate/20090309202916_create_users.rb
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :name
t.string :hashed_password
t.string :salt
t.timestamps
end
end
def self.down
drop_table :users
end
end
rake db:migrate
mv 20090309202916_create_users.rb 20080601000007_create_users.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateUsers: migrating ====================================================
-- create_table(:users)
-> 0.0110s
== CreateUsers: migrated (0.0111s) ===========================================
edit app/models/user.rb
require 'digest/sha1'
class User < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
attr_accessor :password_confirmation
validates_confirmation_of :password
validate :password_non_blank
def self.authenticate(name, password)
user = self.find_by_name(name)
if user
expected_password = encrypted_password(password, user.salt)
if user.hashed_password != expected_password
user = nil
end
end
user
end
# 'password' is a virtual attribute
def password
@password
end
def password=(pwd)
@password = pwd
return if pwd.blank?
create_new_salt
self.hashed_password = User.encrypted_password(self.password, self.salt)
end
private
def password_non_blank
errors.add(:password, "Missing password") if hashed_password.blank?
end
def create_new_salt
self.salt = self.object_id.to_s + rand.to_s
end
def self.encrypted_password(password, salt)
string_to_hash = password + "wibble" + salt
Digest::SHA1.hexdigest(string_to_hash)
end
end
edit app/controllers/users_controller.rb
class UsersController < ApplicationController
# GET /users
# GET /users.xml
def index
@users = User.all(:order => :name)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
# GET /users/1
# GET /users/1.xml
def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @user }
end
end
# GET /users/new
# GET /users/new.xml
def new
@user = User.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @user }
end
end
# GET /users/1/edit
def edit
@user = User.find(params[:id])
end
# POST /users
# POST /users.xml
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
flash[:notice] = "User #{@user.name} was successfully created."
format.html { redirect_to(:action=>'index') }
format.xml { render :xml => @user, :status => :created,
:location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors,
:status => :unprocessable_entity }
end
end
end
# PUT /users/1
# PUT /users/1.xml
def update
@user = User.find(params[:id])
respond_to do |format|
if @user.update_attributes(params[:user])
flash[:notice] = "User #{@user.name} was successfully updated."
format.html { redirect_to(:action=>'index') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @user.errors,
:status => :unprocessable_entity }
end
end
end
# DELETE /users/1
# DELETE /users/1.xml
def destroy
@user = User.find(params[:id])
@user.destroy
respond_to do |format|
format.html { redirect_to(users_url) }
format.xml { head :ok }
end
end
end
edit app/views/users/index.html.erb
<h1>Listing users</h1>
<table>
<tr>
<th>Name</th>
</tr>
<% @users.each do |user| %>
<tr>
<td><%=h user.name %></td>
<td><%= link_to 'Show', user %></td>
<td><%= link_to 'Edit', edit_user_path(user) %></td>
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure?',
:method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New user', new_user_path %>
edit app/views/users/new.html.erb
<div class="depot-form">
<% form_for(@user) do |f| %>
<%= f.error_messages %>
<fieldset>
<legend>Enter User Details</legend>
<div>
<%= f.label :name %>:
<%= f.text_field :name, :size => 40 %>
</div>
<div>
<%= f.label :user_password, 'Password' %>:
<%= f.password_field :password, :size => 40 %>
</div>
<div>
<%= f.label :user_password_confirmation, 'Confirm' %>:
<%= f.password_field :password_confirmation, :size => 40 %>
</div>
<div>
<%= f.submit "Add User", :class => "submit" %>
</div>
</fieldset>
<% end %>
</div>
edit app/views/layouts/users.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Users: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold', 'depot' %>
</head>
get /users
get /users/new
post /users
user[password_confirmation] => secret
user[name] => dave
user[password] => secret
You are being
redirected .
get http://127.0.0.1:3000/users
User dave was successfully created.
Listing users
New user
sqlite3> select * from users
id = 1
name = dave
hashed_password = a6956e78217cd772f241938e443c441e5e8c0a37
salt = 702903715403200.436014828467345
created_at = 2009-03-09 20:29:29
updated_at = 2009-03-09 20:29:29
11.2 Iteration F2: Logging in
ruby script/generate controller admin login logout index
exists app/controllers/
exists app/helpers/
create app/views/admin
exists test/functional/
exists test/unit/helpers/
create app/controllers/admin_controller.rb
create test/functional/admin_controller_test.rb
create app/helpers/admin_helper.rb
create test/unit/helpers/admin_helper_test.rb
create app/views/admin/login.html.erb
create app/views/admin/logout.html.erb
create app/views/admin/index.html.erb
restart
edit app/controllers/admin_controller.rb
class AdminController < ApplicationController
# just display the form and wait for user to
# enter a name and password
def login
if request.post?
user = User.authenticate(params[:name], params[:password])
if user
session[:user_id] = user.id
redirect_to(:action => "index")
else
flash.now[:notice] = "Invalid user/password combination"
end
end
end
def logout
session[:user_id] = nil
flash[:notice] = "Logged out"
redirect_to(:action => "login")
end
def index
@total_orders = Order.count
end
end
edit app/views/admin/login.html.erb
<div class="depot-form">
<% form_tag do %>
<fieldset>
<legend>Please Log In</legend>
<div>
<label for="name">Name:</label>
<%= text_field_tag :name, params[:name] %>
</div>
<div>
<label for="password">Password:</label>
<%= password_field_tag :password, params[:password] %>
</div>
<div>
<%= submit_tag "Login" %>
</div>
</fieldset>
<% end %>
</div>
edit app/views/admin/index.html.erb
<h1>Welcome</h1>
It's <%= Time.now %>
We have <%= pluralize(@total_orders, "order") %>.
get /admin/login
post /admin/login
name => dave
password => secret
You are being
redirected .
get http://127.0.0.1:3000/admin
Welcome
It's Mon Mar 09 16:29:41 -0400 2009
We have 0 orders.
11.3 Iteration F3: Limiting Access
edit app/controllers/application_controller.rb
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
before_filter :authorize, :except => :login
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
protected
def authorize
unless User.find_by_id(session[:user_id])
flash[:notice] = "Please log in"
redirect_to :controller => 'admin', :action => 'login'
end
end
end
edit app/controllers/store_controller.rb
require 'app/models/cart.rb'
require 'app/models/cart_item.rb'
class StoreController < ApplicationController
def index
@products = Product.find_products_for_sale
@cart = find_cart
end
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@current_item = @cart.add_product(product)
respond_to do |format|
format.js if request.xhr?
format.html {redirect_to_index}
end
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid product #{params[:id]}")
redirect_to_index("Invalid product")
end
def checkout
@cart = find_cart
if @cart.items.empty?
redirect_to_index("Your cart is empty")
else
@order = Order.new
end
end
def save_order
@cart = find_cart
@order = Order.new(params[:order])
@order.add_line_items_from_cart(@cart)
if @order.save
session[:cart] = nil
redirect_to_index("Thank you for your order")
else
render :action => 'checkout'
end
end
def empty_cart
session[:cart] = nil
redirect_to_index
end
private
def redirect_to_index(msg = nil)
flash[:notice] = msg if msg
redirect_to :action => 'index'
end
def find_cart
session[:cart] ||= Cart.new
end
end
edit app/controllers/store_controller.rb
class StoreController < ApplicationController
#...
protected
def authorize
end
end
rake db:sessions:clear
(in /home/rubys/svn/RAILS3/Book/util/depot)
get /admin/logout
You are being
redirected .
get http://127.0.0.1:3000/admin/login
get /store
Pragmatic Bookshelf
Please log in
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
get /products
You are being
redirected .
get http://127.0.0.1:3000/admin/login
get /admin/login
post /admin/login
name => dave
password => secret
You are being
redirected .
get http://127.0.0.1:3000/admin
Welcome
It's Mon Mar 09 16:29:43 -0400 2009
We have 0 orders.
get /products
11.4 Iteration F4: A Sidebar, More Administration
edit app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
layout "store"
#...
get /admin
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Admin#index
</h1>
<p>
Showing <i>app/views/layouts/store.html.erb</i> where line <b>#24</b> raised:
<pre><code>You have a nil object when you didn't expect it!
The error occurred while evaluating nil.items</code></pre>
</p>
<p>Extracted source (around line <b>#24</b>):
<pre><code>21: <div id="side">
22: <!-- START_HIGHLIGHT -->
23: <!-- START:hidden_div -->
24: <% hidden_div_if(@cart.items.empty?, :id => "cart") do %>
25: <%= render(:partial => "cart", :object => @cart) %>
26: <% end %>
27: <!-- END:hidden_div -->
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/layouts/store.html.erb:24:in `_run_erb_app47views47layouts47store46html46erb'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:333:in `_render_with_layout'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:255:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1323:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:987:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /users
edit app/views/layouts/store.html.erb
<% if @cart %>
<% hidden_div_if(@cart.items.empty?, :id => "cart") do %>
<%= render(:partial => "cart", :object => @cart) %>
<% end %>
<% end %>
get /admin
Pragmatic Bookshelf
Welcome
It's Mon Mar 09 16:29:44 -0400 2009
We have 0 orders.
get /users
rm app/views/layouts/products.html.erb
rm app/views/layouts/users.html.erb
rm app/views/layouts/orders.html.erb
get /users
Pragmatic Bookshelf
edit app/models/user.rb
require 'digest/sha1'
class User < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
attr_accessor :password_confirmation
validates_confirmation_of :password
validate :password_non_blank
def self.authenticate(name, password)
user = self.find_by_name(name)
if user
expected_password = encrypted_password(password, user.salt)
if user.hashed_password != expected_password
user = nil
end
end
user
end
# 'password' is a virtual attribute
def password
@password
end
def password=(pwd)
@password = pwd
return if pwd.blank?
create_new_salt
self.hashed_password = User.encrypted_password(self.password, self.salt)
end
def after_destroy
if User.count.zero?
raise "Can't delete last user"
end
end
private
def password_non_blank
errors.add(:password, "Missing password") if hashed_password.blank?
end
def create_new_salt
self.salt = self.object_id.to_s + rand.to_s
end
def self.encrypted_password(password, salt)
string_to_hash = password + "wibble" + salt
Digest::SHA1.hexdigest(string_to_hash)
end
end
edit app/controllers/users_controller.rb
class UsersController < ApplicationController
# GET /users
# GET /users.xml
def index
@users = User.all(:order => :name)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
# GET /users/1
# GET /users/1.xml
def show
@user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @user }
end
end
# GET /users/new
# GET /users/new.xml
def new
@user = User.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @user }
end
end
# GET /users/1/edit
def edit
@user = User.find(params[:id])
end
# POST /users
# POST /users.xml
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
flash[:notice] = "User #{@user.name} was successfully created."
format.html { redirect_to(:action=>'index') }
format.xml { render :xml => @user, :status => :created,
:location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors,
:status => :unprocessable_entity }
end
end
end
# PUT /users/1
# PUT /users/1.xml
def update
@user = User.find(params[:id])
respond_to do |format|
if @user.update_attributes(params[:user])
flash[:notice] = "User #{@user.name} was successfully updated."
format.html { redirect_to(:action=>'index') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @user.errors,
:status => :unprocessable_entity }
end
end
end
# DELETE /users/1
# DELETE /users/1.xml
def destroy
@user = User.find(params[:id])
begin
flash[:notice] = "User #{@user.name} deleted"
@user.destroy
rescue Exception => e
flash[:notice] = e.message
end
respond_to do |format|
format.html { redirect_to(users_url) }
format.xml { head :ok }
end
end
end
edit app/controllers/store_controller.rb
def find_cart
@cart = (session[:cart] ||= Cart.new)
end
edit app/controllers/store_controller.rb
before_filter :find_cart, :except => :empty_cart
echo "Product.new" | ruby script/console
>> Product.new
=> #<Product id: nil, title: nil, description: nil, image_url: nil, created_at: nil, updated_at: nil, price: #<BigDecimal:7f04d317a488,'0.0',9(18)>>
>>
12.1 Generating the XML Feed
edit app/models/product.rb
class Product < ActiveRecord::Base
has_many :orders, :through => :line_items
has_many :line_items
# ...
ruby script/generate controller info who_bought
exists app/controllers/
exists app/helpers/
create app/views/info
exists test/functional/
exists test/unit/helpers/
create app/controllers/info_controller.rb
create test/functional/info_controller_test.rb
create app/helpers/info_helper.rb
create test/unit/helpers/info_helper_test.rb
create app/views/info/who_bought.html.erb
edit app/controllers/info_controller.rb
class InfoController < ApplicationController
def who_bought
@product = Product.find(params[:id])
@orders = @product.orders
respond_to do |format|
format.xml { render :layout => false }
end
end
protected
def authorize
end
end
edit app/views/info/who_bought.xml.builder
xml.order_list(:for_product => @product.title) do
for o in @orders
xml.order do
xml.name(o.name)
xml.email(o.email)
end
end
end
curl --silent http://localhost:3000/info/who_bought/3
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>Routing Error</h1>
<p><pre>No route matches "/info/who_bought/3" with {:method=>:get}</pre></p>
</body>
</html>
restart
curl --silent http://localhost:3000/info/who_bought/3
<order_list for_product="Pragmatic Version Control">
</order_list>
sqlite3> select * from products
id = 2
title = Pragmatic Project Automation
description = <p>
<em>Pragmatic Project Automation</em> shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
</p>
<p>
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
</p>
image_url = /images/auto.jpg
created_at = 2009-03-09 20:28:35
updated_at = 2009-03-09 20:28:35
price = 29.95
id = 3
title = Pragmatic Version Control
description = <p>
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
</p>
image_url = /images/svn.jpg
created_at = 2009-03-09 20:28:35
updated_at = 2009-03-09 20:28:35
price = 28.5
id = 4
title = Pragmatic Unit Testing (C#)
description = <p>
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
</p>
<p>
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
</p>
image_url = /images/utc.jpg
created_at = 2009-03-09 20:28:35
updated_at = 2009-03-09 20:28:35
price = 27.75
sqlite3> select * from line_items
curl --silent http://localhost:3000/info/who_bought/3
<order_list for_product="Pragmatic Version Control">
</order_list>
edit app/views/info/who_bought.html.erb
<h3>People Who Bought <%= @product.title %></h3>
<ul>
<% for order in @orders -%>
<li>
<%= mail_to order.email, order.name %>
</li>
<% end -%>
</ul>
edit app/controllers/info_controller.rb
class InfoController < ApplicationController
def who_bought
@product = Product.find(params[:id])
@orders = @product.orders
respond_to do |format|
format.html
format.xml { render :layout => false }
end
end
protected
def authorize
end
end
curl --silent -H "Accept: text/html" http://localhost:3000/info/who_bought/3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- START:jit -->
<html>
<head>
<title>Pragprog Books Online Store</title>
<!-- START:stylesheet -->
<link href="/stylesheets/depot.css?1236630554" media="all" rel="stylesheet" type="text/css" />
<!-- END:stylesheet -->
<script src="/javascripts/prototype.js?1236630489" type="text/javascript"></script>
<script src="/javascripts/effects.js?1236630489" type="text/javascript"></script>
<script src="/javascripts/dragdrop.js?1236630489" type="text/javascript"></script>
<script src="/javascripts/controls.js?1236630489" type="text/javascript"></script>
<script src="/javascripts/application.js?1236630489" type="text/javascript"></script>
</head>
<!-- END:jit -->
<body id="store">
<div id="banner">
<img alt="Logo" src="/images/logo.png?1236630515" />
Pragmatic Bookshelf
</div>
<div id="columns">
<div id="side">
<!-- START:hidden_div -->
<!-- START_HIGHLIGHT -->
<!-- END_HIGHLIGHT -->
<!-- END:hidden_div -->
<a href="http://www....">Home</a><br />
<a href="http://www..../faq">Questions</a><br />
<a href="http://www..../news">News</a><br />
<a href="http://www..../contact">Contact</a><br />
<!-- START_HIGHLIGHT -->
<!-- END_HIGHLIGHT -->
</div>
<div id="main">
<!-- START:flash -->
<!-- END:flash -->
<h3>People Who Bought Pragmatic Version Control</h3>
<ul>
</ul>
</div>
</div>
</body>
</html>
curl --silent -H "Accept: application/xml" http://localhost:3000/info/who_bought/3
<order_list for_product="Pragmatic Version Control">
</order_list>
cp app/controllers/info_controller.rb app/controllers/info_controller.save
edit app/controllers/info_controller.rb
class InfoController < ApplicationController
def who_bought
@product = Product.find(params[:id])
@orders = @product.orders
respond_to do |format|
format.html
format.xml { render :layout => false ,
:xml => @product.to_xml(:include => :orders) }
end
end
protected
def authorize
end
end
curl --silent http://localhost:3000/info/who_bought/3.xml
<?xml version="1.0" encoding="UTF-8"?>
<product>
<created-at type="datetime">2009-03-09T20:28:35Z</created-at>
<description><p>
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
</p></description>
<id type="integer">3</id>
<image-url>/images/svn.jpg</image-url>
<price type="decimal">28.5</price>
<title>Pragmatic Version Control</title>
<updated-at type="datetime">2009-03-09T20:28:35Z</updated-at>
<orders type="array"/>
</product>
edit app/views/info/who_bought.atom.builder
atom_feed do |feed|
feed.title "Who bought #{@product.title}"
feed.updated @orders.first.created_at
for order in @orders
feed.entry(order) do |entry|
entry.title "Order #{order.id}"
entry.summary :type => 'xhtml' do |xhtml|
xhtml.p "Shipped to #{order.address}"
xhtml.table do
xhtml.tr do
xhtml.th 'Product'
xhtml.th 'Quantity'
xhtml.th 'Total Price'
end
for item in order.line_items
xhtml.tr do
xhtml.td item.product.title
xhtml.td item.quantity
xhtml.td number_to_currency item.total_price
end
end
xhtml.tr do
xhtml.th 'total', :colspan => 2
xhtml.th number_to_currency \
order.line_items.map(&:total_price).sum
end
end
xhtml.p "Paid by #{order.pay_type}"
end
entry.author do |author|
entry.name order.name
entry.email order.email
end
end
end
end
edit app/controllers/info_controller.rb
class InfoController < ApplicationController
def who_bought
@product = Product.find(params[:id])
@orders = @product.orders
respond_to do |format|
format.html
format.atom { render :layout => false }
format.xml { render :layout => false ,
:xml => @product.to_xml(:include => :orders) }
end
end
protected
def authorize
end
end
curl --silent http://localhost:3000/info/who_bought/3.atom
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Info#who_bought
</h1>
<p>
Showing <i>app/views/info/who_bought.atom.builder</i> where line <b>#3</b> raised:
<pre><code>You have a nil object when you didn't expect it!
The error occurred while evaluating nil.created_at</code></pre>
</p>
<p>Extracted source (around line <b>#3</b>):
<pre><code>1: atom_feed do |feed|
2: feed.title "Who bought #{@product.title}"
3: feed.updated @orders.first.created_at
4:
5: for order in @orders
6: feed.entry(order) do |entry|
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/depot</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/info/who_bought.atom.builder:3:in `_run_builder_app47views47info47who_bought46atom46builder'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb:121:in `atom_feed'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb:116:in `atom_feed'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/info/who_bought.atom.builder:1:in `_run_builder_app47views47info47who_bought46atom46builder'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:978:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/info_controller.rb:8:in `who_bought'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:135:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:135:in `custom'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:179:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:179:in `respond'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:173:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:173:in `respond'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:107:in `respond_to'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/info_controller.rb:6:in `who_bought'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/info/who_bought.atom.builder:3:in `_run_builder_app47views47info47who_bought46atom46builder'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb:121:in `atom_feed'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb:116:in `atom_feed'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/info/who_bought.atom.builder:1:in `_run_builder_app47views47info47who_bought46atom46builder'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:978:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/info_controller.rb:8:in `who_bought'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:135:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:135:in `custom'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:179:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:179:in `respond'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:173:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:173:in `respond'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:107:in `respond_to'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/info_controller.rb:6:in `who_bought'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/depot/app/views/info/who_bought.atom.builder:3:in `_run_builder_app47views47info47who_bought46atom46builder'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb:121:in `atom_feed'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb:116:in `atom_feed'
/home/rubys/svn/RAILS3/Book/util/depot/app/views/info/who_bought.atom.builder:1:in `_run_builder_app47views47info47who_bought46atom46builder'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:978:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/info_controller.rb:8:in `who_bought'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:135:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:135:in `custom'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:179:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:179:in `respond'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:173:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:173:in `respond'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:107:in `respond_to'
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/info_controller.rb:6:in `who_bought'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:1176:in `depot'
makedepot.rb:2330
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{"format"=>"atom",
"id"=>"3"}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"application/atom+xml",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
edit app/controllers/info_controller.rb
class InfoController < ApplicationController
def who_bought
@product = Product.find(params[:id])
@orders = @product.orders
respond_to do |format|
format.html
format.atom { render :layout => false }
format.xml { render :layout => false ,
:xml => @product.to_xml(:include => :orders) }
format.json { render :layout => false ,
:json => @product.to_json(:include => :orders) }
end
end
protected
def authorize
end
end
curl --silent -H "Accept: application/json" http://localhost:3000/info/who_bought/3
{"product": {"price": 28.5, "created_at": "2009-03-09T20:28:35Z", "title": "Pragmatic Version Control", "image_url": "/images/svn.jpg", "updated_at": "2009-03-09T20:28:35Z", "id": 3, "orders": [], "description": "<p>\n This book is a recipe-based approach to using Subversion that will \n get you up and running quickly---and correctly. All projects need\n version control: it's a foundational piece of any project's \n infrastructure. Yet half of all project teams in the U.S. don't use\n any version control at all. Many others don't use it well, and end \n up experiencing time-consuming problems.\n </p>"}}
mv app/controllers/info_controller.save app/controllers/info_controller.rb
rake doc:app
rm -r doc/app
README_FOR_APP:
orders_controller.rb: c.......
info_controller.rb: c..
products_controller.rb: c.......
application_controller.rb: c.
store_controller.rb: c........
admin_controller.rb: c...
line_items_controller.rb: c.......
users_controller.rb: c.......
orders_helper.rb: m
admin_helper.rb: m
users_helper.rb: m
info_helper.rb: m
application_helper.rb: m
products_helper.rb: m
line_items_helper.rb: m
store_helper.rb: m.
product.rb: c..
cart.rb: c....
user.rb: c.......
order.rb: c.
line_item.rb: c.
cart_item.rb: c....c....
Generating HTML...
(in /home/rubys/svn/RAILS3/Book/util/depot)
Files: 23
Classes: 15
Modules: 8
Methods: 66
Elapsed: 0.962s
rake stats
(in /home/rubys/svn/RAILS3/Book/util/depot)
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 518 | 346 | 8 | 42 | 5 | 6 |
| Helpers | 23 | 22 | 0 | 1 | 0 | 20 |
| Models | 250 | 145 | 7 | 23 | 3 | 4 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Integration tests | 0 | 0 | 0 | 0 | 0 | 0 |
| Functional tests | 204 | 162 | 7 | 0 | 0 | 0 |
| Unit tests | 60 | 45 | 11 | 0 | 0 | 0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | 1055 | 720 | 33 | 66 | 2 | 8 |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: 513 Test LOC: 207 Code to Test Ratio: 1:0.4
13.1 Tests Baked Right In
ls -p test
fixtures/
functional/
integration/
performance/
test_helper.rb
unit/
ls test/unit
helpers
line_item_test.rb
order_test.rb
product_test.rb
user_test.rb
ls test/functional
admin_controller_test.rb
info_controller_test.rb
line_items_controller_test.rb
orders_controller_test.rb
products_controller_test.rb
store_controller_test.rb
users_controller_test.rb
13.2 Unit Testing of Models
cat test/unit/product_test.rb
require 'test_helper'
class ProductTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
ruby -Itest test/unit/product_test.rb
Loaded suite test/unit/product_test
Started
E
Finished in 0.025303 seconds.
1) Error:
test_the_truth(ProductTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: line_items: DELETE FROM "line_items" WHERE 1=1
1 tests, 0 assertions, 0 failures, 1 errors
rake db:test:prepare
(in /home/rubys/svn/RAILS3/Book/util/depot)
ruby -Itest test/unit/product_test.rb
Loaded suite test/unit/product_test
Started
.
Finished in 0.059681 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
rake test:units
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/unit/order_test.rb" "test/unit/helpers/admin_helper_test.rb" "test/unit/helpers/store_helper_test.rb" "test/unit/helpers/line_items_helper_test.rb" "test/unit/helpers/products_helper_test.rb" "test/unit/helpers/info_helper_test.rb" "test/unit/helpers/users_helper_test.rb" "test/unit/helpers/orders_helper_test.rb" "test/unit/product_test.rb" "test/unit/line_item_test.rb" "test/unit/user_test.rb"
(in /home/rubys/svn/RAILS3/Book/util/depot)
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
....
Finished in 0.061808 seconds.
4 tests, 4 assertions, 0 failures, 0 errors
edit test/unit/product_test.rb
require 'test_helper'
class ProductTest < ActiveSupport::TestCase
fixtures :products
# Replace this with your real tests.
test "the truth" do
assert true
end
test "invalid with empty attributes" do
product = Product.new
assert !product.valid?
assert product.errors.invalid?(:title)
assert product.errors.invalid?(:description)
assert product.errors.invalid?(:price)
assert product.errors.invalid?(:image_url)
end
test "positive price" do
product = Product.new(:title => "My Book Title",
:description => "yyy",
:image_url => "zzz.jpg")
product.price = -1
assert !product.valid?
assert_equal "should be at least 0.01", product.errors.on(:price)
product.price = 0
assert !product.valid?
assert_equal "should be at least 0.01", product.errors.on(:price)
product.price = 1
assert product.valid?
end
test "image url" do
ok = %w{ fred.gif fred.jpg fred.png FRED.JPG FRED.Jpg
http://a.b.c/x/y/z/fred.gif }
bad = %w{ fred.doc fred.gif/more fred.gif.more }
ok.each do |name|
product = Product.new(:title => "My Book Title",
:description => "yyy",
:price => 1,
:image_url => name)
assert product.valid?, product.errors.full_messages
end
bad.each do |name|
product = Product.new(:title => "My Book Title",
:description => "yyy",
:price => 1,
:image_url => name)
assert !product.valid?, "saving #{name}"
end
end
test "unique title" do
product = Product.new(:title => products(:ruby_book).title,
:description => "yyy",
:price => 1,
:image_url => "fred.gif")
assert !product.save
assert_equal "has already been taken", product.errors.on(:title)
end
test "unique title1" do
product = Product.new(:title => products(:ruby_book).title,
:description => "yyy",
:price => 1,
:image_url => "fred.gif")
assert !product.save
assert_equal I18n.translate('activerecord.errors.messages.taken'),
product.errors.on(:title)
end
end
edit test/fixtures/products.yml
ruby_book:
title: Programming Ruby
description: Dummy description
price: 1234
image_url: ruby.png
rails_book:
title: Agile Web Development with Rails
description: Dummy description
price: 2345
image_url: rails.png
rake test:units
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/unit/order_test.rb" "test/unit/helpers/admin_helper_test.rb" "test/unit/helpers/store_helper_test.rb" "test/unit/helpers/line_items_helper_test.rb" "test/unit/helpers/products_helper_test.rb" "test/unit/helpers/info_helper_test.rb" "test/unit/helpers/users_helper_test.rb" "test/unit/helpers/orders_helper_test.rb" "test/unit/product_test.rb" "test/unit/line_item_test.rb" "test/unit/user_test.rb"
(in /home/rubys/svn/RAILS3/Book/util/depot)
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
.........
Finished in 0.103164 seconds.
9 tests, 27 assertions, 0 failures, 0 errors
edit test/unit/cart_test.rb
require 'test_helper'
class CartTest < ActiveSupport::TestCase
fixtures :products
def test_add_unique_products
cart = Cart.new
rails_book = products(:rails_book)
ruby_book = products(:ruby_book)
cart.add_product rails_book
cart.add_product ruby_book
assert_equal 2, cart.items.size
assert_equal rails_book.price + ruby_book.price, cart.total_price
end
def test_add_duplicate_product
cart = Cart.new
rails_book = products(:rails_book)
cart.add_product rails_book
cart.add_product rails_book
assert_equal 2*rails_book.price, cart.total_price
assert_equal 1, cart.items.size
assert_equal 2, cart.items[0].quantity
end
end
ruby -I test test/unit/cart_test.rb
Loaded suite test/unit/cart_test
Started
..
Finished in 0.06243 seconds.
2 tests, 5 assertions, 0 failures, 0 errors
edit test/unit/cart_test1.rb
require 'test_helper'
class CartTest < ActiveSupport::TestCase
fixtures :products
def setup
@cart = Cart.new
@rails = products(:rails_book)
@ruby = products(:ruby_book)
end
def test_add_unique_products
@cart.add_product @rails
@cart.add_product @ruby
assert_equal 2, @cart.items.size
assert_equal @rails.price + @ruby.price, @cart.total_price
end
def test_add_duplicate_product
@cart.add_product @rails
@cart.add_product @rails
assert_equal 2*@rails.price, @cart.total_price
assert_equal 1, @cart.items.size
assert_equal 2, @cart.items[0].quantity
end
end
ruby -I test test/unit/cart_test1.rb
Loaded suite test/unit/cart_test1
Started
..
Finished in 0.072714 seconds.
2 tests, 5 assertions, 0 failures, 0 errors
13.3 Functional Testing of Controllers
edit app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
layout "store"
before_filter :authorize, :except => :login
#...
protected
def authorize
unless User.find_by_id(session[:user_id])
flash[:notice] = "Please log in"
redirect_to :controller => 'admin', :action => 'login'
end
end
end
edit test/functional/admin_controller_test.rb
require 'test_helper'
class AdminControllerTest < ActionController::TestCase
fixtures :users
# Replace this with your real tests.
test "the truth" do
assert true
end
if false
test "index" do
get :index
assert_response :success
end
end
test "index without user" do
get :index
assert_redirected_to :action => "login"
assert_equal "Please log in", flash[:notice]
end
test "index with user" do
get :index, {}, { :user_id => users(:dave).id }
assert_response :success
assert_template "index"
end
test "login" do
dave = users(:dave)
post :login, :name => dave.name, :password => 'secret'
assert_redirected_to :action => "index"
assert_equal dave.id, session[:user_id]
end
test "bad password" do
dave = users(:dave)
post :login, :name => dave.name, :password => 'wrong'
assert_template "login"
end
end
edit test/fixtures/users.yml
<% SALT = "NaCl" unless defined?(SALT) %>
dave:
name: dave
salt: <%= SALT %>
hashed_password: <%= User.encrypted_password('secret', SALT) %>
ruby -I test test/functional/admin_controller_test.rb
Loaded suite test/functional/admin_controller_test
Started
.....
Finished in 0.100826 seconds.
5 tests, 8 assertions, 0 failures, 0 errors
13.4 Integration Testing of Applications
ruby script/generate integration_test user_stories
exists test/integration/
create test/integration/user_stories_test.rb
edit test/integration/user_stories_test.rb
require 'test_helper'
class UserStoriesTest < ActionController::IntegrationTest
fixtures :products
# A user goes to the index page. They select a product, adding it to their
# cart, and check out, filling in their details on the checkout form. When
# they submit, an order is created containing their information, along with a
# single line item corresponding to the product they added to their cart.
test "buying a product" do
LineItem.delete_all
Order.delete_all
ruby_book = products(:ruby_book)
get "/store/index"
assert_response :success
assert_template "index"
xml_http_request :put, "/store/add_to_cart", :id => ruby_book.id
assert_response :success
cart = session[:cart]
assert_equal 1, cart.items.size
assert_equal ruby_book, cart.items[0].product
post "/store/checkout"
assert_response :success
assert_template "checkout"
post_via_redirect "/store/save_order",
:order => { :name => "Dave Thomas",
:address => "123 The Street",
:email => "dave@pragprog.com",
:pay_type => "check" }
assert_response :success
assert_template "index"
assert_equal 0, session[:cart].items.size
orders = Order.find(:all)
assert_equal 1, orders.size
order = orders[0]
assert_equal "Dave Thomas", order.name
assert_equal "123 The Street", order.address
assert_equal "dave@pragprog.com", order.email
assert_equal "check", order.pay_type
assert_equal 1, order.line_items.size
line_item = order.line_items[0]
assert_equal ruby_book, line_item.product
end
end
ruby -I test test/integration/user_stories_test.rb
Loaded suite test/integration/user_stories_test
Started
.
Finished in 0.278813 seconds.
1 tests, 17 assertions, 0 failures, 0 errors
edit test/integration/dsl_user_stories_test.rb
require 'test_helper'
class DslUserStoriesTest < ActionController::IntegrationTest
fixtures :products
DAVES_DETAILS = {
:name => "Dave Thomas",
:address => "123 The Street",
:email => "dave@pragprog.com",
:pay_type => "check"
}
MIKES_DETAILS = {
:name => "Mike Clark",
:address => "345 The Avenue",
:email => "mike@pragmaticstudio.com",
:pay_type => "cc"
}
def setup
LineItem.delete_all
Order.delete_all
@ruby_book = products(:ruby_book)
@rails_book = products(:rails_book)
end
# A user goes to the store index page. They select a product,
# adding it to their cart. They then check out, filling in
# their details on the checkout form. When they submit,
# an order is created in the database containing
# their information, along with a single line item
# corresponding to the product they added to their cart.
def test_buying_a_product
dave = regular_user
dave.get "/store/index"
dave.is_viewing "index"
dave.buys_a @ruby_book
dave.has_a_cart_containing @ruby_book
dave.checks_out DAVES_DETAILS
dave.is_viewing "index"
check_for_order DAVES_DETAILS, @ruby_book
end
def test_two_people_buying
dave = regular_user
mike = regular_user
dave.buys_a @ruby_book
mike.buys_a @rails_book
dave.has_a_cart_containing @ruby_book
dave.checks_out DAVES_DETAILS
mike.has_a_cart_containing @rails_book
check_for_order DAVES_DETAILS, @ruby_book
mike.checks_out MIKES_DETAILS
check_for_order MIKES_DETAILS, @rails_book
end
def regular_user
open_session do |user|
def user.is_viewing(page)
assert_response :success
assert_template page
end
def user.buys_a(product)
xml_http_request :put, "/store/add_to_cart", :id => product.id
assert_response :success
end
def user.has_a_cart_containing(*products)
cart = session[:cart]
assert_equal products.size, cart.items.size
for item in cart.items
assert products.include?(item.product)
end
end
def user.checks_out(details)
post "/store/checkout"
assert_response :success
assert_template "checkout"
post_via_redirect "/store/save_order",
:order => { :name => details[:name],
:address => details[:address],
:email => details[:email],
:pay_type => details[:pay_type]
}
assert_response :success
assert_template "index"
assert_equal 0, session[:cart].items.size
end
end
end
def check_for_order(details, *products)
order = Order.find_by_name(details[:name])
assert_not_nil order
assert_equal details[:name], order.name
assert_equal details[:address], order.address
assert_equal details[:email], order.email
assert_equal details[:pay_type], order.pay_type
assert_equal products.size, order.line_items.size
for line_item in order.line_items
assert products.include?(line_item.product)
end
end
end
ruby -I test test/integration/dsl_user_stories_test.rb
Loaded suite test/integration/dsl_user_stories_test
Started
..
Finished in 0.443839 seconds.
2 tests, 49 assertions, 0 failures, 0 errors
13.5 Performance Testing
mkdir test/fixtures/performance/
edit test/fixtures/performance/products.yml
<% 1.upto(1000) do |i| %>
product_<%= i %>:
id: <%= i %>
title: Product Number <%= i %>
description: My description
image_url: product.gif
price: 1234
<% end %>
edit test/performance/order_speed_test.rb
require 'test_helper'
require 'store_controller'
class OrderSpeedTest < ActionController::TestCase
tests StoreController
DAVES_DETAILS = {
:name => "Dave Thomas",
:address => "123 The Street",
:email => "dave@pragprog.com",
:pay_type => "check"
}
self.fixture_path = File.join(File.dirname(__FILE__), "../fixtures/performance")
fixtures :products
def test_100_orders
Order.delete_all
LineItem.delete_all
@controller.logger.silence do
elapsed_time = Benchmark.realtime do
100.downto(1) do |prd_id|
cart = Cart.new
cart.add_product(Product.find(prd_id))
post :save_order,
{ :order => DAVES_DETAILS },
{ :cart => cart }
assert_redirected_to :action => :index
end
end
assert_equal 100, Order.count
assert elapsed_time < 3.00
end
end
end
ruby -I test test/performance/order_speed_test.rb
Loaded suite test/performance/order_speed_test
Started
.
Finished in 2.737051 seconds.
1 tests, 102 assertions, 0 failures, 0 errors
edit app/models/user.rb
require 'digest/sha1'
class User < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
attr_accessor :password_confirmation
validates_confirmation_of :password
validate :password_non_blank
def self.authenticate(name, password)
user = self.find_by_name(name)
if user
expected_password = encrypted_password(password, user.salt)
if user.hashed_password != expected_password
user = nil
end
end
user
end
# 'password' is a virtual attribute
def password
@password
end
def password=(pwd)
@password = pwd
return if pwd.blank?
create_new_salt
self.hashed_password = User.encrypted_password(self.password, self.salt)
end
def after_destroy
if User.count.zero?
raise "Can't delete last user"
end
end
private
def password_non_blank
errors.add(:password, "Missing password") if hashed_password.blank?
end
def create_new_salt
self.salt = self.object_id.to_s + rand.to_s
end
def self.encrypted_password(password, salt)
100000.times { Math.sin(1)}
string_to_hash = password + "wibble" + salt
Digest::SHA1.hexdigest(string_to_hash)
end
end
ruby script/performance/benchmarker "User.encrypted_password(\"secret\", \"salt\")"
user system total real
#1 0.140000 0.020000 0.160000 ( 0.156160)
ruby script/performance/profiler "User.encrypted_password(\"secret\", \"salt\")"
Loading Rails...
Using the standard Ruby profiler.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
50.48 2.61 2.61 100000 0.03 0.03 Math.sin
46.42 5.01 2.40 1 2400.00 5010.00 Integer#times
0.77 5.05 0.04 36 1.11 2.22 Array#each
0.77 5.09 0.04 5 8.00 10.00 Array#map
0.58 5.12 0.03 4 7.50 10.00 Array#select
0.19 5.13 0.01 757 0.01 0.01 Hash#key?
0.19 5.14 0.01 2 5.00 110.00 ActiveSupport::Dependencies.new_constants_in
0.19 5.15 0.01 9 1.11 1.11 Object#method_added
0.19 5.16 0.01 3 3.33 3.33 String#+
0.19 5.17 0.01 765 0.01 0.01 String#to_s
0.00 5.17 0.00 2 0.00 0.00 ActiveSupport::Dependencies.load?
0.00 5.17 0.00 14 0.00 0.00 File#expand_path
0.00 5.17 0.00 1 0.00 0.00 Digest::Class#hexdigest
0.00 5.17 0.00 1 0.00 0.00 Digest::Base#finish
0.00 5.17 0.00 1 0.00 150.00 ActiveSupport::Dependencies.require_or_load
0.00 5.17 0.00 2 0.00 0.00 Digest::Base#reset
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::Dependencies.load_once_path?
0.00 5.17 0.00 4 0.00 0.00 ActiveSupport::Callbacks::CallbackChain#extract_options
0.00 5.17 0.00 2 0.00 0.00 Kernel.respond_to?
0.00 5.17 0.00 12 0.00 0.00 String#empty?
0.00 5.17 0.00 1 0.00 0.00 Digest::Instance.digest
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::DynamicScopeMatch#match
0.00 5.17 0.00 4 0.00 0.00 ActiveSupport::Callbacks::Callback#initialize
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::Dependencies.qualified_name_for
0.00 5.17 0.00 4 0.00 0.00 String#blank?
0.00 5.17 0.00 2 0.00 0.00 Kernel.hash
0.00 5.17 0.00 4 0.00 0.00 ActiveSupport::Callbacks::CallbackChain#build
0.00 5.17 0.00 12 0.00 0.00 String#split
0.00 5.17 0.00 1 0.00 70.00 ActiveSupport::Dependencies::Loadable.require
0.00 5.17 0.00 2 0.00 0.00 ActiveSupport::Dependencies.mechanism
0.00 5.17 0.00 3 0.00 0.00 Class#inheritable_attributes
0.00 5.17 0.00 1 0.00 0.00 NameError#initialize
0.00 5.17 0.00 2 0.00 0.00 String#size
0.00 5.17 0.00 1 0.00 160.00 ActiveSupport::Dependencies.load_missing_constant
0.00 5.17 0.00 2 0.00 0.00 Symbol#to_sym
0.00 5.17 0.00 5 0.00 0.00 Hash#default
0.00 5.17 0.00 3 0.00 0.00 File#file?
0.00 5.17 0.00 1 0.00 0.00 String#tr
0.00 5.17 0.00 12 0.00 0.00 Hash#[]=
0.00 5.17 0.00 3 0.00 0.00 Array#*
0.00 5.17 0.00 2 0.00 0.00 Hash#initialize_copy
0.00 5.17 0.00 1 0.00 0.00 Digest::Base#update
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::Validations::ClassMethods.validates_uniqueness_of
0.00 5.17 0.00 1 0.00 0.00 Observable.notify_observers
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::DynamicFinderMatch#match
0.00 5.17 0.00 4 0.00 0.00 Object#duplicable?
0.00 5.17 0.00 12 0.00 0.00 Class#new
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::Dependencies.load_once_paths
0.00 5.17 0.00 1 0.00 0.00 Array#uniq!
0.00 5.17 0.00 6 0.00 0.00 ActiveSupport::Dependencies.constant_watch_stack_mutex
0.00 5.17 0.00 21 0.00 0.00 Module#const_get
0.00 5.17 0.00 1 0.00 0.00 String#ends_with?
0.00 5.17 0.00 4 0.00 0.00 Module#ancestors
0.00 5.17 0.00 1 0.00 5170.00 Object#profile_me
0.00 5.17 0.00 2 0.00 0.00 Kernel.==
0.00 5.17 0.00 2 0.00 0.00 Kernel.equal?
0.00 5.17 0.00 1 0.00 10.00 ActiveSupport::Dependencies.search_for_file
0.00 5.17 0.00 2 0.00 0.00 Array#-
0.00 5.17 0.00 11 0.00 0.00 Enumerable.inject
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::Dependencies.warnings_on_first_load
0.00 5.17 0.00 1 0.00 0.00 Object#initialize
0.00 5.17 0.00 5 0.00 0.00 ActiveSupport::Dependencies.log_call
0.00 5.17 0.00 4 0.00 0.00 ActiveSupport::CoreExtensions::String::Inflections.constantize
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::Dependencies.history
0.00 5.17 0.00 4 0.00 0.00 ActiveSupport::Dependencies.log
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::DynamicFinderMatch#initialize
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::Observing::ClassMethods.inherited
0.00 5.17 0.00 1 0.00 0.00 Module#private
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::DynamicScopeMatch#initialize
0.00 5.17 0.00 1 0.00 150.00 ActiveSupport::Dependencies.load_file
0.00 5.17 0.00 1 0.00 10.00 ActiveRecord::Validations::ClassMethods.validates_confirmation_of
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::Dependencies.to_constant_name
0.00 5.17 0.00 6 0.00 0.00 String#[]
0.00 5.17 0.00 4 0.00 0.00 ActiveRecord::Base#validate
0.00 5.17 0.00 2 0.00 0.00 Array#initialize_copy
0.00 5.17 0.00 10 0.00 0.00 Array#concat
0.00 5.17 0.00 2 0.00 0.00 Array#blank?
0.00 5.17 0.00 10 0.00 0.00 Fixnum#==
0.00 5.17 0.00 8 0.00 0.00 ActiveSupport::Dependencies.qualified_const_defined?
0.00 5.17 0.00 7 0.00 0.00 String#==
0.00 5.17 0.00 2 0.00 0.00 Kernel.instance_variable_set
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::Inflector.underscore
0.00 5.17 0.00 1 0.00 0.00 Array#uniq
0.00 5.17 0.00 11 0.00 0.00 Regexp#escape
0.00 5.17 0.00 20 0.00 0.00 Module#constants
0.00 5.17 0.00 10 0.00 0.00 ActiveSupport::Dependencies.uninherited_const_defined?
0.00 5.17 0.00 3 0.00 0.00 ActiveSupport::Dependencies.loaded
0.00 5.17 0.00 4 0.00 0.00 ActiveSupport::Inflector.constantize
0.00 5.17 0.00 4 0.00 32.50 ActiveSupport::CoreExtensions::Module.local_constant_names
0.00 5.17 0.00 10 0.00 13.00 Array#collect
0.00 5.17 0.00 18 0.00 0.00 Kernel.object_id
0.00 5.17 0.00 1 0.00 0.00 Exception#initialize
0.00 5.17 0.00 9 0.00 0.00 ActiveSupport::Dependencies.logger
0.00 5.17 0.00 2 0.00 0.00 Array#delete_if
0.00 5.17 0.00 1 0.00 160.00 ActiveSupport::Dependencies::ModuleConstMissing.const_missing
0.00 5.17 0.00 2 0.00 0.00 ActiveRecord::Validations::ClassMethods.validates_each
0.00 5.17 0.00 9 0.00 0.00 ActiveSupport::Dependencies.log_activity
0.00 5.17 0.00 1 0.00 0.00 Kernel.require
0.00 5.17 0.00 1 0.00 0.00 NilClass#nil?
0.00 5.17 0.00 18 0.00 0.00 Kernel.is_a?
0.00 5.17 0.00 2 0.00 0.00 Kernel.singleton_method_added
0.00 5.17 0.00 5 0.00 0.00 Array#empty?
0.00 5.17 0.00 1 0.00 0.00 Kernel.gem_original_require
0.00 5.17 0.00 3 0.00 0.00 String#upcase
0.00 5.17 0.00 1 0.00 0.00 TrueClass#duplicable?
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::Validations::ClassMethods.validates_presence_of
0.00 5.17 0.00 6 0.00 0.00 ActiveSupport::Dependencies.constant_watch_stack
0.00 5.17 0.00 30 0.00 0.00 Module#==
0.00 5.17 0.00 9 0.00 0.00 ActiveSupport::CoreExtensions::Array::ExtractOptions.extract_options!
0.00 5.17 0.00 9 0.00 0.00 Array#last
0.00 5.17 0.00 2 0.00 0.00 ActiveSupport::CoreExtensions::String::Inflections.camelize
0.00 5.17 0.00 6 0.00 0.00 Module#name
0.00 5.17 0.00 5 0.00 0.00 Array#initialize
0.00 5.17 0.00 7 0.00 0.00 String#gsub
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::Base#inherited
0.00 5.17 0.00 1 0.00 0.00 Array#compact
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::CoreExtensions::String::Inflections.underscore
0.00 5.17 0.00 5 0.00 0.00 Symbol#===
0.00 5.17 0.00 4 0.00 0.00 Regexp#===
0.00 5.17 0.00 3 0.00 0.00 Hash#each
0.00 5.17 0.00 12 0.00 0.00 Array#first
0.00 5.17 0.00 2 0.00 0.00 Set#include?
0.00 5.17 0.00 4 0.00 0.00 Array#map!
0.00 5.17 0.00 2 0.00 0.00 ActiveSupport::Inflector.camelize
0.00 5.17 0.00 3 0.00 0.00 File#join
0.00 5.17 0.00 8 0.00 0.00 Hash#update
0.00 5.17 0.00 1 0.00 0.00 Digest::Class#digest
0.00 5.17 0.00 9 0.00 0.00 Module#blank_slate_method_added
0.00 5.17 0.00 4 0.00 0.00 Array#<<
0.00 5.17 0.00 1 0.00 0.00 ActiveRecord::Base#respond_to?
0.00 5.17 0.00 5 0.00 0.00 Array#flatten
0.00 5.17 0.00 6 0.00 0.00 Mutex#synchronize
0.00 5.17 0.00 2 0.00 0.00 Class#inherited
0.00 5.17 0.00 2 0.00 0.00 Hash#include?
0.00 5.17 0.00 7 0.00 0.00 Array#include?
0.00 5.17 0.00 5 0.00 0.00 Array#pop
0.00 5.17 0.00 1 0.00 5010.00 User#encrypted_password
0.00 5.17 0.00 1 0.00 80.00 Kernel.load_without_new_constant_marking
0.00 5.17 0.00 2 0.00 5.00 Module#attr_accessor
0.00 5.17 0.00 1 0.00 0.00 ActiveSupport::Dependencies.loadable_constants_for_path
0.00 5.17 0.00 3 0.00 0.00 Kernel.send
0.00 5.17 0.00 3 0.00 0.00 Module#===
0.00 5.17 0.00 14 0.00 0.00 Module#const_defined?
0.00 5.17 0.00 3 0.00 0.00 String#starts_with?
0.00 5.17 0.00 5 0.00 0.00 Symbol#to_s
0.00 5.17 0.00 2 0.00 0.00 Set#<<
0.00 5.17 0.00 2 0.00 0.00 ActiveSupport::Dependencies.autoloaded_constants
0.00 5.17 0.00 2 0.00 0.00 ActiveSupport::CoreExtensions::Hash::Keys.symbolize_keys
0.00 5.17 0.00 2 0.00 0.00 ActiveSupport::Dependencies.load_paths
0.00 5.17 0.00 1 0.00 0.00 String#downcase
0.00 5.17 0.00 1 0.00 0.00 Enumerable.any?
0.00 5.17 0.00 1 0.00 160.00 ActiveSupport::Dependencies::ClassConstMissing.const_missing
0.00 5.17 0.00 4 0.00 20.00 ActiveSupport::CoreExtensions::Module.local_constants
0.00 5.17 0.00 4 0.00 0.00 Kernel.dup
0.00 5.17 0.00 1 0.00 0.00 Observable.changed
0.00 5.17 0.00 4 0.00 0.00 Kernel.block_given?
0.00 5.17 0.00 4 0.00 0.00 Array#flatten!
0.00 5.17 0.00 3 0.00 0.00 ActiveRecord::Validations::ClassMethods.validation_method
0.00 5.17 0.00 13 0.00 0.00 Hash#[]
0.00 5.17 0.00 1 0.00 5170.00 #toplevel
edit app/models/user.rb
14 Rails In Depth
rake db:version
(in /home/rubys/svn/RAILS3/Book/util/depot)
Current version: 20080601000007
edit lib/tasks/db_schema_migrations.rake
namespace :db do
desc "Prints the migrated versions"
task :schema_migrations => :environment do
puts ActiveRecord::Base.connection.select_values(
'select version from schema_migrations order by version' )
end
end
rake db:schema_migrations
(in /home/rubys/svn/RAILS3/Book/util/depot)
20080601000001
20080601000002
20080601000003
20080601000004
20080601000005
20080601000006
20080601000007
ls log
development.log
development.log.0
production.log
server.log
test.log
find script -type f
script/runner
script/dbconsole
script/generate
script/performance/profiler
script/performance/benchmarker
script/console
script/about
script/destroy
script/plugin
script/server
echo "puts $:" | ruby script/console
>> puts $:
/home/rubys/svn/RAILS3/Book/util/depot/vendor/plugins/acts_as_list/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.12
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib/active_support/vendor/memcache-client-1.6.5
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers/
/home/rubys/svn/RAILS3/Book/util/depot/app
/home/rubys/svn/RAILS3/Book/util/depot/app/models
/home/rubys/svn/RAILS3/Book/util/depot/app/controllers
/home/rubys/svn/RAILS3/Book/util/depot/app/helpers
/home/rubys/svn/RAILS3/Book/util/depot/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/plugins/annotate_models/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/plugins/acts_as_tree/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/plugins/acts_as_list/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor
/home/rubys/svn/RAILS3/Book/util/depot/config/../vendor/rails/railties/lib/../builtin/rails_info/
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/railties/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activesupport/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionpack/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activerecord/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/actionmailer/lib
/home/rubys/svn/RAILS3/Book/util/depot/vendor/rails/activeresource/lib
/home/rubys/svn/RAILS3/Book/util/depot/config/../vendor/rails/railties/lib
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/bin
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib
/usr/lib/ruby/gems/1.8/gems/mocha-0.9.4/bin
/usr/lib/ruby/gems/1.8/gems/mocha-0.9.4/lib
/usr/local/lib/site_ruby/1.8
/usr/local/lib/site_ruby/1.8/x86_64-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/vendor_ruby/1.8
/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux
/usr/lib/ruby/vendor_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/x86_64-linux
.
=> nil
>>
11.9 I18N
get /store/empty_cart
You are being
redirected .
get http://127.0.0.1:3000/store
Pragmatic Bookshelf
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
cp ../data/i18n/initializer.rb config/initializers/i18n.rb
restart
edit app/views/layouts/store.html.erb
<% form_tag '', :method => 'GET', :class => 'locale' do %>
<%= select_tag 'locale', options_for_select(LANGUAGES, I18n.locale),
:onchange => 'this.form.submit()' %>
<%= submit_tag 'submit' %>
<%= javascript_tag "$$('.locale input').each(Element.hide)" %>
<% end %>
get /store?locale=en
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
edit app/controllers/application_controller.rb
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
layout "store"
before_filter :authorize, :except => :login
before_filter :set_locale
#...
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details
# Scrub sensitive parameters from your log
# filter_parameter_logging :password
protected
def authorize
unless User.find_by_id(session[:user_id])
flash[:notice] = "Please log in"
redirect_to :controller => 'admin', :action => 'login'
end
end
def set_locale
session[:locale] = params[:locale] if params[:locale]
I18n.locale = session[:locale] || I18n.default_locale
locale_path = "#{LOCALES_DIRECTORY}#{I18n.locale}.yml"
unless I18n.load_path.include? locale_path
I18n.load_path << locale_path
I18n.backend.send(:init_translations)
end
rescue Exception => err
logger.error err
flash.now[:notice] = "#{I18n.locale} translation not available"
I18n.load_path -= [locale_path]
I18n.locale = session[:locale] = I18n.default_locale
end
end
edit public/stylesheets/depot.css
.locale {
float:right;
padding-top: 0.2em
}
restart
get /store?locale=es
es translation not available
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
edit app/views/layouts/store.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Pragprog Books Online Store</title>
<%= stylesheet_link_tag "depot", :media => "all" %>
<%= javascript_include_tag :defaults %>
</head>
<body id="store">
<div id="banner">
<% form_tag '', :method => 'GET', :class => 'locale' do %>
<%= select_tag 'locale', options_for_select(LANGUAGES, I18n.locale),
:onchange => 'this.form.submit()' %>
<%= submit_tag 'submit' %>
<%= javascript_tag "$$('.locale input').each(Element.hide)" %>
<% end %>
<%= image_tag("logo.png") %>
<%= @page_title || I18n.t('layout.title') %>
</div>
<div id="columns">
<div id="side">
<% if @cart %>
<% hidden_div_if(@cart.items.empty?, :id => "cart") do %>
<%= render(:partial => "cart", :object => @cart) %>
<% end %>
<% end %>
<a href="http://www...."><%= I18n.t 'layout.side.home' %></a><br />
<a href="http://www..../faq"><%= I18n.t 'layout.side.questions' %></a><br />
<a href="http://www..../news"><%= I18n.t 'layout.side.news' %></a><br />
<a href="http://www..../contact"><%= I18n.t 'layout.side.contact' %></a><br />
<% if session[:user_id] %>
<br />
<%= link_to 'Orders', :controller => 'orders' %><br />
<%= link_to 'Products', :controller => 'products' %><br />
<%= link_to 'Users', :controller => 'users' %><br />
<br />
<%= link_to 'Logout', :controller => 'admin', :action => 'logout' %>
<% end %>
</div>
<div id="main">
<% if flash[:notice] -%>
<div id="notice"><%= flash[:notice] %></div>
<% end -%>
<%= yield :layout %>
</div>
</div>
</body>
</html>
cp -r ../data/i18n/*.yml config/locales
get /store?locale=es
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
edit app/views/store/index.html.erb
<h1><%= I18n.t 'main.title' %></h1>
<% for product in @products -%>
<div class="entry">
<%= image_tag(product.image_url) %>
<h3><%=h product.title %></h3>
<%= product.description %>
<div class="price-line">
<span class="price"><%= number_to_currency(product.price) %></span>
<% form_remote_tag :url => {:action => 'add_to_cart', :id => product} do %>
<%= submit_tag I18n.t('main.button.add') %>
<% end %>
</div>
</div>
<% end %>
get /store?locale=es
Su Catálogo de Pragmatic
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
edit app/views/store/_cart.html.erb
<div class="cart-title"><%= I18n.t 'layout.cart.title' %></div>
<table>
<%= render(:partial => "cart_item", :collection => cart.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 I18n.t('layout.cart.button.checkout'), :action => 'checkout' %>
<%= button_to I18n.t('layout.cart.button.empty'), :action => :empty_cart %>
get /store/add_to_cart/2
You are being
redirected .
get http://127.0.0.1:3000/store
Su Catálogo de Pragmatic
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
edit app/views/store/checkout.html.erb
<div class="depot-form">
<%= error_messages_for 'order' %>
<% form_for :order, :url => { :action => :save_order } do |form| %>
<fieldset>
<legend><%= I18n.t 'checkout.legend' %></legend>
<div>
<%= form.label :name, I18n.t('checkout.name') + ":" %>
<%= form.text_field :name, :size => 40 %>
</div>
<div>
<%= form.label :address, I18n.t('checkout.address') + ":" %>
<%= form.text_area :address, :rows => 3, :cols => 40 %>
</div>
<div>
<%= form.label :email, I18n.t('checkout.email') + ":" %>
<%= form.text_field :email, :size => 40 %>
</div>
<div>
<%= form.label :pay_type, I18n.t('checkout.pay_type') + ":" %>
<%=
form.select :pay_type,
Order::PAYMENT_TYPES,
:prompt => I18n.t('checkout.pay_prompt')
%>
</div>
<%= submit_tag I18n.t('checkout.submit'), :class => "submit" %>
</fieldset>
<% end %>
</div>
edit app/controllers/store_controller.rb
require 'app/models/cart.rb'
require 'app/models/cart_item.rb'
class StoreController < ApplicationController
before_filter :find_cart, :except => :empty_cart
def index
@products = Product.find_products_for_sale
end
def add_to_cart
product = Product.find(params[:id])
@current_item = @cart.add_product(product)
respond_to do |format|
format.js if request.xhr?
format.html {redirect_to_index}
end
rescue ActiveRecord::RecordNotFound
logger.error("Attempt to access invalid product #{params[:id]}")
redirect_to_index("Invalid product")
end
def checkout
if @cart.items.empty?
redirect_to_index("Your cart is empty")
else
@order = Order.new
end
end
def save_order
@order = Order.new(params[:order])
@order.add_line_items_from_cart(@cart)
if @order.save
session[:cart] = nil
redirect_to_index(I18n.t('flash.thanks'))
else
render :action => 'checkout'
end
end
def empty_cart
session[:cart] = nil
redirect_to_index
end
private
def redirect_to_index(msg = nil)
flash[:notice] = msg if msg
redirect_to :action => 'index'
end
def find_cart
@cart = (session[:cart] ||= Cart.new)
end
#...
protected
def authorize
end
end
get /store?locale=es
Su Catálogo de Pragmatic
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
get /store/add_to_cart/2
You are being
redirected .
get http://127.0.0.1:3000/store
Su Catálogo de Pragmatic
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
get /store/checkout
get /store/save_order
get /store/save_order
post /store/save_order
order[pay_type] => check
order[address] => 123 Main St., Anytown USA
order[email] => juser@hotmail.com
order[name] => Joe User
You are being
redirected .
get http://127.0.0.1:3000/store
Gracias por su pedido
Su Catálogo de Pragmatic
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
get /store?locale=en
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
25 ActiveResource
rails depot_client
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
ln -s ~/git/rails vendor/rails
edit app/models/product.rb
class Product < ActiveResource::Base
self.site = 'http://dave:secret@localhost:3000/'
end
echo "Product.find(2).title" | ruby script/console
>> Product.find(2).title
ActiveResource::Redirection: Failed with 302 Found => http://localhost:3000/admin/login
from /home/rubys/svn/RAILS3/Book/util/depot_client/vendor/rails/activeresource/lib/active_resource/connection.rb:160:in `handle_response'
from /home/rubys/svn/RAILS3/Book/util/depot_client/vendor/rails/activeresource/lib/active_resource/connection.rb:151:in `request'
from /home/rubys/svn/RAILS3/Book/util/depot_client/vendor/rails/activeresource/lib/active_resource/connection.rb:116:in `get'
from /home/rubys/svn/RAILS3/Book/util/depot_client/vendor/rails/activeresource/lib/active_resource/base.rb:595:in `find_single'
from /home/rubys/svn/RAILS3/Book/util/depot_client/vendor/rails/activeresource/lib/active_resource/base.rb:523:in `find'
from (irb):1
>>
edit app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
layout "store"
before_filter :authorize, :except => :login
before_filter :set_locale
#...
protected
def authorize
unless User.find_by_id(session[:user_id])
if session[:user_id] != :logged_out
authenticate_or_request_with_http_basic('Depot') do |username, password|
user = User.authenticate(username, password)
session[:user_id] = user.id if user
end
else
flash[:notice] = "Please log in"
redirect_to :controller => 'admin', :action => 'login'
end
end
end
def set_locale
session[:locale] = params[:locale] if params[:locale]
I18n.locale = session[:locale] || I18n.default_locale
locale_path = "#{LOCALES_DIRECTORY}#{I18n.locale}.yml"
unless I18n.load_path.include? locale_path
I18n.load_path << locale_path
I18n.backend.send(:init_translations)
end
rescue Exception => err
logger.error err
flash.now[:notice] = "#{I18n.locale} translation not available"
I18n.load_path -= [locale_path]
I18n.locale = session[:locale] = I18n.default_locale
end
end
edit app/controllers/admin_controller.rb
class AdminController < ApplicationController
# just display the form and wait for user to
# enter a name and password
def login
if request.post?
user = User.authenticate(params[:name], params[:password])
if user
session[:user_id] = user.id
redirect_to(:action => "index")
else
flash.now[:notice] = "Invalid user/password combination"
end
end
end
def logout
session[:user_id] = :logged_out
flash[:notice] = "Logged out"
redirect_to(:action => "login")
end
def index
@total_orders = Order.count
end
end
edit app/controllers/line_items_controller.rb
def create
params[:line_item][:order_id] ||= params[:order_id]
@line_item = LineItem.new(params[:line_item])
respond_to do |format|
if @line_item.save
flash[:notice] = 'LineItem was successfully created.'
format.html { redirect_to(@line_item) }
format.xml { render :xml => @line_item, :status => :created,
:location => @line_item }
else
format.html { render :action => "new" }
format.xml { render :xml => @line_item.errors,
:status => :unprocessable_entity }
end
end
end
edit config/routes.rb
ActionController::Routing::Routes.draw do |map|
map.resources :users
map.resources :line_items
map.resources :orders, :has_many => :line_items
map.resources :products
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# map.resources :products
# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
# Sample resource route with sub-resources:
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
# Sample resource route with more complex sub-resources
# map.resources :products do |products|
# products.resources :comments
# products.resources :sales, :collection => { :recent => :get }
# end
# Sample resource route within a namespace:
# map.namespace :admin do |admin|
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
# admin.resources :products
# end
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
# map.root :controller => "welcome"
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every controller accessible via GET requests. You should
# consider removing the them or commenting them out if you're using named routes and resources.
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
restart
echo "Product.find(2).title" | ruby script/console
>> Product.find(2).title
=> "Pragmatic Project Automation"
>>
echo 'p = Product.find(2)
puts p.price
p.price-=5
p.save' | ruby script/console
>> p = Product.find(2)
=> #<Product:0x7f3777d2e7f8 @prefix_options={}, @attributes={"price"=>#<BigDecimal:7f37773d9658,'0.2995E2',18(18)>, "created_at"=>Mon Mar 09 20:28:35 UTC 2009, "title"=>"Pragmatic Project Automation", "image_url"=>"/images/auto.jpg", "updated_at"=>Mon Mar 09 20:28:35 UTC 2009, "id"=>2, "description"=>"<p>\n <em>Pragmatic Project Automation</em> shows you how to improve the \n consistency and repeatability of your project's procedures using \n automation to reduce risk and errors.\n </p>\n <p>\n Simply put, we're going to put this thing called a computer to work \n for you doing the mundane (but important) project stuff. That means \n you'll have more time and energy to do the really \n exciting---and difficult---stuff, like writing quality code.\n </p>"}>
>> puts p.price
29.95
=> nil
>> p.price-=5
=> #<BigDecimal:7f3774a2fca8,'0.2495E2',18(36)>
>> p.save
=> true
>>
get /store
Your Pragmatic Catalog
Pragmatic Project Automation
Pragmatic Project Automation shows you how to improve the
consistency and repeatability of your project's procedures using
automation to reduce risk and errors.
Simply put, we're going to put this thing called a computer to work
for you doing the mundane (but important) project stuff. That means
you'll have more time and energy to do the really
exciting---and difficult---stuff, like writing quality code.
Pragmatic Unit Testing (C#)
Pragmatic programmers use feedback to drive their development and
personal processes. The most valuable feedback you can get while
coding comes from unit testing.
Without good tests in place, coding can become a frustrating game of
"whack-a-mole." That's the carnival game where the player strikes at a
mechanical mole; it retreats and another mole pops up on the opposite side
of the field. The moles pop up and down so fast that you end up flailing
your mallet helplessly as the moles continue to pop up where you least
expect them.
Pragmatic Version Control
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project's
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
edit app/models/order.rb
class Order < ActiveResource::Base
self.site = 'http://dave:secret@localhost:3000/'
end
echo 'Order.find(1).name
Order.find(1).line_items
' | ruby script/console
>> Order.find(1).name
=> "Joe User"
>> Order.find(1).line_items
NoMethodError: undefined method `line_items' for #<Order:0x7ff558983d70>
from /home/rubys/svn/RAILS3/Book/util/depot_client/vendor/rails/activeresource/lib/active_resource/base.rb:1073:in `method_missing'
from (irb):2
>>
?> >>
edit app/models/line_item.rb
class LineItem < ActiveResource::Base
self.site = 'http://dave:secret@localhost:3000/orders/:order_id'
end
get /orders/1/line_items.xml
<?xml version="1.0" encoding="UTF-8"?>
<line-items type="array">
<line-item>
<created-at type="datetime">2009-03-09T20:31:08Z</created-at>
<id type="integer">1</id>
<order-id type="integer">1</order-id>
<product-id type="integer">2</product-id>
<quantity type="integer">2</quantity>
<total-price type="decimal">59.9</total-price>
<updated-at type="datetime">2009-03-09T20:31:08Z</updated-at>
</line-item>
</line-items>
echo "LineItem.find(:all, :params => {:order_id=>1})" |ruby script/console
>> LineItem.find(:all, :params => {:order_id=>1})
=> [#<LineItem:0x7feeb85b0b18 @prefix_options={:order_id=>1}, @attributes={"created_at"=>Mon Mar 09 20:31:08 UTC 2009, "product_id"=>2, "quantity"=>2, "total_price"=>#<BigDecimal:7feeb85b1ec8,'0.599E2',18(18)>, "updated_at"=>Mon Mar 09 20:31:08 UTC 2009, "id"=>1}>]
>>
echo 'li = LineItem.find(:all, :params => {:order_id=>1}).first
puts li.total_price
li.total_price*=0.8
li.save
li2 = LineItem.new(:order_id=>1, :product_id=>2, :quantity=>1, :total_price=>0.0)
li2.save' | ruby script/console
>> li = LineItem.find(:all, :params => {:order_id=>1}).first
=> #<LineItem:0x7f0495af52a8 @prefix_options={:order_id=>1}, @attributes={"created_at"=>Mon Mar 09 20:31:08 UTC 2009, "product_id"=>2, "quantity"=>2, "total_price"=>#<BigDecimal:7f0495afa500,'0.599E2',18(18)>, "updated_at"=>Mon Mar 09 20:31:08 UTC 2009, "id"=>1}>
>> puts li.total_price
59.9
=> nil
>> li.total_price*=0.8
=> 47.92
>> li.save
=> true
>> li2 = LineItem.new(:order_id=>1, :product_id=>2, :quantity=>1, :total_price=>0.0)
=> #<LineItem:0x7f04928444f8 @prefix_options={:order_id=>1}, @attributes={"product_id"=>2, "quantity"=>1, "total_price"=>0.0}>
>> li2.save
=> true
>>
15 Active Support
rails namelist
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
ln -s ~/git/rails vendor/rails
restart
ruby script/generate model person name:string
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/person.rb
create test/unit/person_test.rb
create test/fixtures/people.yml
create db/migrate
create db/migrate/20090309203144_create_people.rb
rake db:migrate
mv 20090309203144_create_people.rb 20080601000001_create_people.rb
(in /home/rubys/svn/RAILS3/Book/util/namelist)
== CreatePeople: migrating ===================================================
-- create_table(:people)
-> 0.0130s
== CreatePeople: migrated (0.0132s) ==========================================
edit app/controllers/people_controller.rb
class PeopleController < ApplicationController
def index
@person = Person.new(params[:person])
@person.save! if request.post?
@people = Person.find(:all)
end
end
edit app/views/layouts/people.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"></meta>
<title>My Name List</title>
</head>
<body>
<%= yield :layout %>
</body>
</html>
mkdir app/views/people
edit app/views/people/index.html.erb
<table border="1">
<tr>
<th>Name</th><th>bytes</th><th>chars</th><th>reversed</th>
</tr>
<% for person in @people %>
<tr>
<td><%=h person.name %></td>
<td><%= person.name.length %></td>
<td><%= person.name.chars.length %></td>
<td><%=h person.name.chars.reverse %></td>
</tr>
<% end %>
</table>
<% form_for :person do |form| %>
New name: <%= form.text_field :name %>
<%= submit_tag "Add" %>
<% end %>
get /people
Routing Error
No route matches "/people" with {:method=>:get}
get /people
Routing Error
No route matches "/people" with {:method=>:get}
sqlite3> select name,length(name) from people where name like 'G%'
16 Migration
restart
ruby script/generate model discount
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/discount.rb
create test/unit/discount_test.rb
create test/fixtures/discounts.yml
exists db/migrate
create db/migrate/20090309203159_create_discounts.rb
ruby script/generate migration add_status_to_user status:string
exists db/migrate
create db/migrate/20090309203200_add_status_to_user.rb
rake db:migrate
mv 20090309203159_create_discounts.rb 20080601000008_create_discounts.rb
mv 20090309203200_add_status_to_user.rb 20080601000009_add_status_to_user.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateDiscounts: migrating ================================================
-- create_table(:discounts)
-> 0.0173s
== CreateDiscounts: migrated (0.0174s) =======================================
== AddStatusToUser: migrating ================================================
-- add_column(:users, :status, :string)
-> 0.0273s
== AddStatusToUser: migrated (0.0274s) =======================================
cp -v ../data/migrate/020* db/migrate
`../data/migrate/020_add_email_to_orders.rb' -> `db/migrate/020_add_email_to_orders.rb'
rake db:migrate
mv 020_add_email_to_orders.rb 20080601000010_add_email_to_orders.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== AddEmailToOrders: migrating ===============================================
-- add_column(:orders, :e_mail, :string)
-> 0.0443s
== AddEmailToOrders: migrated (0.0445s) ======================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000010
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/021* db/migrate
`../data/migrate/021_add_placed_at_to_orders.rb' -> `db/migrate/021_add_placed_at_to_orders.rb'
rake db:migrate
mv 021_add_placed_at_to_orders.rb 20080601000011_add_placed_at_to_orders.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== AddPlacedAtToOrders: migrating ============================================
-- add_column(:orders, :placed_at, :datetime, {:default=>Mon Mar 09 16:32:05 -0400 2009})
-> 0.0430s
== AddPlacedAtToOrders: migrated (0.0431s) ===================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000011
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/022* db/migrate
`../data/migrate/022_add_columns_to_orders.rb' -> `db/migrate/022_add_columns_to_orders.rb'
rake db:migrate
mv 022_add_columns_to_orders.rb 20080601000012_add_columns_to_orders.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== AddColumnsToOrders: migrating =============================================
-- add_column(:orders, :attn, :string, {:limit=>100})
-> 0.0400s
-- add_column(:orders, :order_type, :integer)
-> 0.0343s
-- add_column(:orders, :ship_class, :string, {:null=>false, :default=>"priority"})
-> 0.0322s
-- add_column(:orders, :amount, :decimal, {:scale=>2, :precision=>8})
-> 0.0357s
-- add_column(:orders, :state, :string, {:limit=>2})
-> 0.0358s
== AddColumnsToOrders: migrated (0.1785s) ====================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000012
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/023* db/migrate
`../data/migrate/023_rename_email_column.rb' -> `db/migrate/023_rename_email_column.rb'
rake db:migrate
mv 023_rename_email_column.rb 20080601000013_rename_email_column.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== RenameEmailColumn: migrating ==============================================
-- rename_column(:orders, :e_mail, :customer_email)
-> 0.0472s
== RenameEmailColumn: migrated (0.0473s) =====================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000013
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/024* db/migrate
`../data/migrate/024_change_order_type_to_string.rb' -> `db/migrate/024_change_order_type_to_string.rb'
rake db:migrate
mv 024_change_order_type_to_string.rb 20080601000014_change_order_type_to_string.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== ChangeOrderTypeToString: migrating ========================================
-- change_column(:orders, :order_type, :string)
-> 0.0548s
== ChangeOrderTypeToString: migrated (0.0549s) ===============================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000014
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/025* db/migrate
`../data/migrate/025_create_order_histories.rb' -> `db/migrate/025_create_order_histories.rb'
rake db:migrate
mv 025_create_order_histories.rb 20080601000015_create_order_histories.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateOrderHistories: migrating ===========================================
-- create_table(:order_histories)
-> 0.0154s
== CreateOrderHistories: migrated (0.0156s) ==================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000015
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/026* db/migrate
`../data/migrate/026_create_table_tickets.rb' -> `db/migrate/026_create_table_tickets.rb'
rake db:migrate
mv 026_create_table_tickets.rb 20080601000016_create_table_tickets.rb
rake aborted!
An error has occurred, all later migrations canceled:
SQLite3::SQLException: near "auto_increment": syntax error: CREATE TABLE "tickets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "description" text, "text" text, "created_at" datetime, "updated_at" datetime) auto_increment = 10000
(See full trace by running task with --trace)
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateTableTickets: migrating =============================================
-- create_table(:tickets, {:options=>"auto_increment = 10000"})
rm db/migrate/20080601000016_create_table_tickets.rb
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000015
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/027* db/migrate
`../data/migrate/027_rename_order_histories.rb' -> `db/migrate/027_rename_order_histories.rb'
rake db:migrate
mv 027_rename_order_histories.rb 20080601000016_rename_order_histories.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== RenameOrderHistories: migrating ===========================================
-- rename_table(:order_histories, :order_notes)
-> 0.0119s
== RenameOrderHistories: migrated (0.0121s) ==================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000016
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/028* db/migrate
`../data/migrate/028_create_order_histories2.rb' -> `db/migrate/028_create_order_histories2.rb'
rake db:migrate
mv 028_create_order_histories2.rb 20080601000017_create_order_histories2.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateOrderHistories2: migrating ==========================================
-- create_table(:order_histories)
-> 0.0139s
== CreateOrderHistories2: migrated (0.0406s) =================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000017
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/029* db/migrate
`../data/migrate/029_add_customer_name_index_to_orders.rb' -> `db/migrate/029_add_customer_name_index_to_orders.rb'
rake db:migrate
mv 029_add_customer_name_index_to_orders.rb 20080601000018_add_customer_name_index_to_orders.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== AddCustomerNameIndexToOrders: migrating ===================================
-- add_index(:orders, :name)
-> 0.0135s
== AddCustomerNameIndexToOrders: migrated (0.0136s) ==========================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000018
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/030* db/migrate
`../data/migrate/030_create_author_book.rb' -> `db/migrate/030_create_author_book.rb'
rake db:migrate
mv 030_create_author_book.rb 20080601000019_create_author_book.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateAuthorBook: migrating ===============================================
-- create_table(:authors_books, {:id=>false})
-> 0.0191s
== CreateAuthorBook: migrated (0.0192s) ======================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000019
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/031* db/migrate
`../data/migrate/031_create_table_tickets.rb' -> `db/migrate/031_create_table_tickets.rb'
rake db:migrate
mv 031_create_table_tickets.rb 20080601000020_create_table_tickets.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== CreateTableTickets: migrating =============================================
-- create_table(:tickets, {:primary_key=>:number})
-> 0.0165s
== CreateTableTickets: migrated (0.0166s) ====================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000020
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/032* db/migrate
`../data/migrate/032_test_discounts.rb' -> `db/migrate/032_test_discounts.rb'
rake db:migrate
mv 032_test_discounts.rb 20080601000021_test_discounts.rb
rake aborted!
An error has occurred, all later migrations canceled:
uninitialized constant TestDiscounts::Sku
(See full trace by running task with --trace)
(in /home/rubys/svn/RAILS3/Book/util/depot)
== TestDiscounts: migrating ==================================================
== TestDiscounts: reverting ==================================================
== TestDiscounts: reverted (0.0036s) =========================================
rm db/migrate/20080601000021_test_discounts.rb
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000020
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
mkdir db/migrate/dev_data
cp ../data/migrate/users.yml db/migrate/dev_data
rake db:migrate
(in /home/rubys/svn/RAILS3/Book/util/depot)
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000020
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/034* db/migrate
`../data/migrate/034_load_user_data.rb' -> `db/migrate/034_load_user_data.rb'
rake db:migrate
mv 034_load_user_data.rb 20080601000021_load_user_data.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== LoadUserData: migrating ===================================================
== LoadUserData: reverting ===================================================
== LoadUserData: reverted (0.0164s) ==========================================
== LoadUserData: migrated (0.0365s) ==========================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000021
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :decimal(8, 2) not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/035* db/migrate
`../data/migrate/035_change_price_to_integer.rb' -> `db/migrate/035_change_price_to_integer.rb'
rake db:migrate
mv 035_change_price_to_integer.rb 20080601000022_change_price_to_integer.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== ChangePriceToInteger: migrating ===========================================
-- change_column(:line_items, :total_price, :integer)
-> 0.0275s
== ChangePriceToInteger: migrated (0.0502s) ==================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000022
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :integer not null
# created_at :datetime
# updated_at :datetime
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/036* db/migrate
`../data/migrate/036_total_price_to_unit.rb' -> `db/migrate/036_total_price_to_unit.rb'
rake db:migrate
mv 036_total_price_to_unit.rb 20080601000023_total_price_to_unit.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== TotalPriceToUnit: migrating ===============================================
-- add_column(:line_items, :unit_price, {:scale=>2, :precision=>8})
-> 0.0329s
== TotalPriceToUnit: migrated (0.0538s) ======================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000023
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :integer not null
# created_at :datetime
# updated_at :datetime
# unit_price :
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
cp -v ../data/migrate/037* db/migrate
`../data/migrate/037_add_foreign_key.rb' -> `db/migrate/037_add_foreign_key.rb'
cp -v ../data/migrate/migration_helpers.rb lib
`../data/migrate/migration_helpers.rb' -> `lib/migration_helpers.rb'
rake db:migrate
mv 037_add_foreign_key.rb 20080601000024_add_foreign_key.rb
(in /home/rubys/svn/RAILS3/Book/util/depot)
== AddForeignKey: migrating ==================================================
-- execute("\n CREATE TRIGGER fk_line_items_products_insert\n BEFORE INSERT ON line_items\n FOR EACH ROW BEGIN\n SELECT \n\t RAISE(ABORT, \"constraint violation: fk_line_items_products\")\n\tWHERE \n\t (SELECT id FROM products WHERE id = NEW.product_id) IS NULL;\n END;\n ")
-> 0.0188s
-- execute("\n CREATE TRIGGER fk_line_items_products_update\n BEFORE UPDATE ON line_items\n FOR EACH ROW BEGIN\n SELECT \n\t RAISE(ABORT, \"constraint violation: fk_line_items_products\")\n\tWHERE \n\t (SELECT id FROM products WHERE id = NEW.product_id) IS NULL;\n END;\n ")
-> 0.0113s
-- execute("\n CREATE TRIGGER fk_line_items_products_delete\n BEFORE DELETE ON products\n FOR EACH ROW BEGIN\n SELECT \n\t RAISE(ABORT, \"constraint violation: fk_line_items_products\")\n\tWHERE \n\t (SELECT id FROM line_items WHERE product_id = OLD.id) IS NOT NULL;\n END;\n ")
-> 0.0138s
-- execute("\n CREATE TRIGGER fk_line_items_orders_insert\n BEFORE INSERT ON line_items\n FOR EACH ROW BEGIN\n SELECT \n\t RAISE(ABORT, \"constraint violation: fk_line_items_orders\")\n\tWHERE \n\t (SELECT id FROM orders WHERE id = NEW.order_id) IS NULL;\n END;\n ")
-> 0.0093s
-- execute("\n CREATE TRIGGER fk_line_items_orders_update\n BEFORE UPDATE ON line_items\n FOR EACH ROW BEGIN\n SELECT \n\t RAISE(ABORT, \"constraint violation: fk_line_items_orders\")\n\tWHERE \n\t (SELECT id FROM orders WHERE id = NEW.order_id) IS NULL;\n END;\n ")
-> 0.0103s
-- execute("\n CREATE TRIGGER fk_line_items_orders_delete\n BEFORE DELETE ON orders\n FOR EACH ROW BEGIN\n SELECT \n\t RAISE(ABORT, \"constraint violation: fk_line_items_orders\")\n\tWHERE \n\t (SELECT id FROM line_items WHERE order_id = OLD.id) IS NOT NULL;\n END;\n ")
-> 0.0114s
== AddForeignKey: migrated (0.0755s) =========================================
rake annotate_models
(in /home/rubys/svn/RAILS3/Book/util/depot)
Annotating Product
Skipping Cart
Annotating User
Annotating Order
Annotating LineItem
Skipping CartItem
Annotating Discount
cat app/models/line_item.rb
# == Schema Information
# Schema version: 20080601000024
#
# Table name: line_items
#
# id :integer not null, primary key
# product_id :integer not null
# order_id :integer not null
# quantity :integer not null
# total_price :integer not null
# created_at :datetime
# updated_at :datetime
# unit_price :
#
#START:belongs_to
class LineItem < ActiveRecord::Base
belongs_to :order
belongs_to :product
#END:belongs_to
def self.from_cart_item(cart_item)
li = self.new
li.product = cart_item.product
li.quantity = cart_item.quantity
li.total_price = cart_item.price
li
end
#START:belongs_to
end
#END:belongs_to
17 ActiveRecord
echo "Order.column_names" | ruby script/console
>> Order.column_names
=> ["id", "name", "address", "email", "pay_type", "created_at", "updated_at", "customer_email", "placed_at", "attn", "order_type", "ship_class", "amount", "state"]
>>
echo "Order.columns_hash[\"pay_type\"]" | ruby script/console
>> Order.columns_hash["pay_type"]
=> #<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x7f862fd829a0 @primary=false, @type=:string, @limit=10, @null=true, @scale=nil, @sql_type="varchar(10)", @name="pay_type", @default=nil, @precision=nil>
>>
sqlite3> select * from orders limit 1
id = 1
name = Joe User
address = 123 Main St., Anytown USA
email = juser@hotmail.com
pay_type = check
created_at = 2009-03-09 20:31:08
updated_at = 2009-03-09 20:31:08
customer_email =
placed_at = 2009-03-09 16:32:05
attn =
order_type =
ship_class = priority
amount =
state =
echo "Product.find(:first).price_before_type_cast" | ruby script/console
>> Product.find(:first).price_before_type_cast
=> "24.95"
>>
echo "Product.find(:first).updated_at_before_type_cast" | ruby script/console
>> Product.find(:first).updated_at_before_type_cast
=> "2009-03-09 20:31:26"
>>
irb e1/ar/new_examples.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> class Order < ActiveRecord::Base
>> end
=> nil
?> an_order = Order.new
=> #<Order id: nil, name: nil, address: nil, email: nil, pay_type: nil, created_at: nil, updated_at: nil, customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
>> an_order.name = "Dave Thomas"
=> "Dave Thomas"
>> an_order.email = "dave@pragprog.com"
=> "dave@pragprog.com"
>> an_order.address = "123 Main St"
=> "123 Main St"
>> an_order.pay_type = "check"
=> "check"
>> an_order.save
=> true
?> Order.new do |o|
?> o.name = "Dave Thomas"
>> # . . .
?> o.save
>> end
=> #<Order id: 3, name: "Dave Thomas", address: nil, email: nil, pay_type: nil, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
?> an_order = Order.new(
?> :name => "Dave Thomas",
?> :email => "dave@pragprog.com",
?> :address => "123 Main St",
?> :pay_type => "check")
=> #<Order id: nil, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: nil, updated_at: nil, customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
>> an_order.save
=> true
?> an_order = Order.new
=> #<Order id: nil, name: nil, address: nil, email: nil, pay_type: nil, created_at: nil, updated_at: nil, customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
>> an_order.name = "Dave Thomas"
=> "Dave Thomas"
>> # ...
?> an_order.save
=> true
>> puts "The ID of this order is #{an_order.id}"
The ID of this order is 5
=> nil
?> an_order = Order.create(
?> :name => "Dave Thomas",
?> :email => "dave@pragprog.com",
?> :address => "123 Main St",
?> :pay_type => "check")
=> #<Order id: 6, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
?> orders = Order.create(
?> [ { :name => "Dave Thomas",
?> :email => "dave@pragprog.com",
?> :address => "123 Main St",
?> :pay_type => "check"
>> },
?> { :name => "Andy Hunt",
?> :email => "andy@pragprog.com",
?> :address => "456 Gentle Drive",
?> :pay_type => "po"
>> } ] )
=> [#<Order id: 7, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 8, name: "Andy Hunt", address: "456 Gentle Drive", email: "andy@pragprog.com", pay_type: "po", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>]
>> >> => nil
irb e1/ar/find_examples.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> ActiveRecord::Base.logger = Logger.new(STDOUT)
=> #<Logger:0x7f30e12bc820 @level=0, @progname=nil, @formatter=nil, @default_formatter=#<Logger::Formatter:0x7f30e12bc7d0 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x7f30e12bc730 @dev=#<IO:0x7f30e4662ad0>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x7f30e12bc6e0 @mon_entering_queue=[], @mon_count=0, @mon_owner=nil, @mon_waiting_queue=[]>, @shift_size=nil, @filename=nil, @shift_age=nil>>
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> require "pp"
=> ["PP"]
>> @params = {}
=> {}
>> def params
>> @params
>> end
=> nil
?> class Order < ActiveRecord::Base
>> named_scope :check, :conditions => {:pay_type => 'check'}
>> named_scope :cc, :conditions => {:pay_type => 'cc'}
>> named_scope :po, :conditions => {:pay_type => 'po'}
>> end
=> #<Proc:0x00007f30e10a34f8@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/named_scope.rb:96>
?> class Order < ActiveRecord::Base
>> named_scope :recent, :conditions => ['created_at > ?', 1.week.ago]
>> named_scope :since, lambda { |range|
?> { :conditions => ['created_at > ?', range] }
>> }
>> end
=> #<Proc:0x00007f30e10a34f8@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/named_scope.rb:96>
>> class LineItem < ActiveRecord::Base
>> end
=> nil
>> class Product < ActiveRecord::Base
>> end
=> nil
?> # return an arbitrary order
?> order = Order.find(:first)
Order Load (1.2ms) SELECT * FROM "orders" LIMIT 1
=> #<Order id: 1, name: "Joe User", address: "123 Main St., Anytown USA", email: "juser@hotmail.com", pay_type: "check", created_at: "2009-03-09 20:31:08", updated_at: "2009-03-09 20:31:08", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
>> # return an order for Dave
?> order = Order.find(:first, :conditions => "name = 'Dave Thomas'")
Order Load (0.5ms) SELECT * FROM "orders" WHERE (name = 'Dave Thomas') LIMIT 1
=> #<Order id: 2, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
>> # return the latest order for Dave
?> order = Order.find(:first,
?> :conditions => "name = 'Dave Thomas'",
?> :order => "id DESC")
Order Load (0.5ms) SELECT * FROM "orders" WHERE (name = 'Dave Thomas') ORDER BY id DESC LIMIT 1
=> #<Order id: 7, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
?> orders = LineItem.find_by_sql("select line_items.* from line_items, orders " +
?> " where order_id = orders.id " +
?> " and orders.name = 'Dave Thomas' ")
LineItem Load (0.2ms) select line_items.* from line_items, orders where order_id = orders.id and orders.name = 'Dave Thomas'
=> []
?> orders = Order.find_by_sql("select name, pay_type from orders")
Order Load (0.5ms) select name, pay_type from orders
=> [#<Order name: "Joe User", pay_type: "check">, #<Order name: "Dave Thomas", pay_type: "check">, #<Order name: "Dave Thomas", pay_type: nil>, #<Order name: "Dave Thomas", pay_type: "check">, #<Order name: "Dave Thomas", pay_type: nil>, #<Order name: "Dave Thomas", pay_type: "check">, #<Order name: "Dave Thomas", pay_type: "check">, #<Order name: "Andy Hunt", pay_type: "po">]
>> first = orders[0]
=> #<Order name: "Joe User", pay_type: "check">
>> p first.attributes
{"name"=>"Joe User", "pay_type"=>"check"}
=> nil
>> p first.attribute_names
["name", "pay_type"]
=> nil
>> p first.attribute_present?("address")
false
=> nil
?> p Order.all
Order Load (1.4ms) SELECT * FROM "orders"
[#<Order id: 1, name: "Joe User", address: "123 Main St., Anytown USA", email: "juser@hotmail.com", pay_type: "check", created_at: "2009-03-09 20:31:08", updated_at: "2009-03-09 20:31:08", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 2, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 3, name: "Dave Thomas", address: nil, email: nil, pay_type: nil, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 4, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 5, name: "Dave Thomas", address: nil, email: nil, pay_type: nil, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 6, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 7, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 8, name: "Andy Hunt", address: "456 Gentle Drive", email: "andy@pragprog.com", pay_type: "po", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>]
=> nil
>> p Order.check(:order => "created_on desc").first
Order Load (0.6ms) SELECT * FROM "orders" WHERE ("orders"."pay_type" = 'check') LIMIT 1
#<Order id: 1, name: "Joe User", address: "123 Main St., Anytown USA", email: "juser@hotmail.com", pay_type: "check", created_at: "2009-03-09 20:31:08", updated_at: "2009-03-09 20:31:08", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
=> nil
>> p Order.po.recent.count
SQL (0.3ms) SELECT count(*) AS count_all FROM "orders" WHERE ((created_at > '2009-03-02 16:32:55') AND ("orders"."pay_type" = 'po'))
1
=> nil
>> p Order.check.find_by_name('Dave Thomas')
Order Load (0.5ms) SELECT * FROM "orders" WHERE ("orders"."name" = 'Dave Thomas') AND ("orders"."pay_type" = 'check') LIMIT 1
#<Order id: 2, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
=> nil
?> p Order.po.recent(:order => :created_at)
Order Load (0.5ms) SELECT * FROM "orders" WHERE ((created_at > '2009-03-02 16:32:55') AND ("orders"."pay_type" = 'po'))
[#<Order id: 8, name: "Andy Hunt", address: "456 Gentle Drive", email: "andy@pragprog.com", pay_type: "po", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>]
=> nil
>> p Order.po.since(1.week.ago)
Order Load (0.5ms) SELECT * FROM "orders" WHERE ((created_at > '2009-03-02 16:32:55') AND ("orders"."pay_type" = 'po'))
[#<Order id: 8, name: "Andy Hunt", address: "456 Gentle Drive", email: "andy@pragprog.com", pay_type: "po", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>]
=> nil
>> LineItem.delete_all
LineItem Delete all (13.1ms) DELETE FROM "line_items" WHERE 1=1
=> 2
>> Product.delete_all
Product Delete all (10.3ms) DELETE FROM "products" WHERE 1=1
=> 3
>> p = Product.create(:title => "Programming Ruby", :price => 49.95)
Product Create (0.3ms) INSERT INTO "products" ("price", "created_at", "title", "image_url", "updated_at", "description") VALUES(49.95, '2009-03-09 16:32:55', 'Programming Ruby', NULL, '2009-03-09 16:32:55', NULL)
=> #<Product id: 5, title: "Programming Ruby", description: nil, image_url: nil, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", price: #<BigDecimal:7f30e11977b0,'0.4995E2',18(18)>>
>> LineItem.create(:quantity => 2, :unit_price => 49.95, :total_price => 99.90,
?> :product_id => p.id, :order_id => first)
LineItem Create (0.4ms) INSERT INTO "line_items" ("created_at", "product_id", "quantity", "order_id", "total_price", "updated_at", "unit_price") VALUES('2009-03-09 16:32:55', 5, 2, 1, 99, '2009-03-09 16:32:55', 49.95)
=> #<LineItem id: 3, product_id: 5, order_id: 1, quantity: 2, total_price: 99, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", unit_price: 49.95>
?> items = LineItem.find_by_sql("select *, " +
?> " quantity*unit_price as total_price, " +
?> " products.title as title " +
?> " from line_items, products " +
?> " where line_items.product_id = products.id ")
LineItem Load (0.6ms) select *, quantity*unit_price as total_price, products.title as title from line_items, products where line_items.product_id = products.id
=> [#<LineItem id: 5, product_id: 5, order_id: 1, quantity: 2, total_price: 99, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", unit_price: "49.95">]
>> li = items[0]
=> #<LineItem id: 5, product_id: 5, order_id: 1, quantity: 2, total_price: 99, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", unit_price: "49.95">
>> puts "#{li.title}: #{li.quantity}x#{li.unit_price} => #{li.total_price}"
Programming Ruby: 2x49.95 => 99
=> nil
?> c1 = Order.count
SQL (0.2ms) SELECT count(*) AS count_all FROM "orders"
=> 8
>> c2 = Order.count(:conditions => ["name = ?", "Dave Thomas"])
SQL (0.2ms) SELECT count(*) AS count_all FROM "orders" WHERE (name = 'Dave Thomas')
=> 6
>> c3 = LineItem.count_by_sql("select count(*) " +
?> " from line_items, orders " +
?> " where line_items.order_id = orders.id " +
?> " and orders.name = 'Dave Thomas' ")
LineItem Count (0.3ms) select count(*) from line_items, orders where line_items.order_id = orders.id and orders.name = 'Dave Thomas'
=> 0
>> puts "Dave has #{c3} line items in #{c2} orders (#{c1} orders in all)"
Dave has 0 line items in 6 orders (8 orders in all)
=> nil
?> order = Order.find_by_name("Dave Thomas")
Order Load (0.5ms) SELECT * FROM "orders" WHERE ("orders"."name" = 'Dave Thomas') LIMIT 1
=> #<Order id: 2, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>
>> orders = Order.find_all_by_name("Dave Thomas")
Order Load (1.1ms) SELECT * FROM "orders" WHERE ("orders"."name" = 'Dave Thomas')
=> [#<Order id: 2, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 3, name: "Dave Thomas", address: nil, email: nil, pay_type: nil, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 4, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 5, name: "Dave Thomas", address: nil, email: nil, pay_type: nil, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 6, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 7, name: "Dave Thomas", address: "123 Main St", email: "dave@pragprog.com", pay_type: "check", created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>]
>> orders = Order.find_all_by_email(params['email'])
Order Load (0.5ms) SELECT * FROM "orders" WHERE ("orders"."email" IS NULL)
=> [#<Order id: 3, name: "Dave Thomas", address: nil, email: nil, pay_type: nil, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>, #<Order id: 5, name: "Dave Thomas", address: nil, email: nil, pay_type: nil, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", customer_email: nil, placed_at: "2009-03-09 16:32:05", attn: nil, order_type: nil, ship_class: "priority", amount: nil, state: nil>]
>> o = LineItem.find(:all,
?> :conditions => "pr.title = 'Programming Ruby'",
?> :joins => "inner join products as pr on line_items.product_id = pr.id")
LineItem Load (0.4ms) SELECT "line_items".* FROM "line_items" inner join products as pr on line_items.product_id = pr.id WHERE (pr.title = 'Programming Ruby')
=> [#<LineItem id: 3, product_id: 5, order_id: 1, quantity: 2, total_price: 99, created_at: "2009-03-09 16:32:55", updated_at: "2009-03-09 16:32:55", unit_price: "49.95">]
>> p o.size
1
=> nil
>> LineItem.delete_all
LineItem Delete all (8.2ms) DELETE FROM "line_items" WHERE 1=1
=> 1
>> res = Order.update_all("pay_type = 'wibble'")
Order Update (5.8ms) UPDATE "orders" SET pay_type = 'wibble'
=> 8
>> p res
8
=> nil
>> res = Order.delete_all(["pay_type = ?", "wibble"])
Order Delete all (12.7ms) DELETE FROM "orders" WHERE (pay_type = 'wibble')
=> 8
>> p res
8
=> nil
irb e1/ar/dump_serialize_table.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require 'connect'
=> true
>> require 'rubygems'
=> []
>> require 'activerecord'
=> []
>> require 'pp'
=> ["PP"]
>> ActiveRecord::Schema.define do
?> create_table :purchases, :force => true do |t|
?> t.string :name
>> t.text :last_five
>> end
>> end
-- create_table(:purchases, {:force=>true})
-> 0.0394s
=> nil
?> class Purchase < ActiveRecord::Base
>> serialize :last_five
>> # ...
?> end
=> Object
?> purchase = Purchase.new
=> #<Purchase id: nil, name: nil, last_five: nil>
>> purchase.name = "Dave Thomas"
=> "Dave Thomas"
>> purchase.last_five = [ 'shoes', 'shirt', 'socks', 'ski mask', 'shorts' ]
=> ["shoes", "shirt", "socks", "ski mask", "shorts"]
>> purchase.save
=> true
?> purchase = Purchase.find_by_name("Dave Thomas")
=> #<Purchase id: 1, name: "Dave Thomas", last_five: ["shoes", "shirt", "socks", "ski mask", "shorts"]>
>> pp purchase.last_five
["shoes", "shirt", "socks", "ski mask", "shorts"]
=> nil
>> pp purchase.last_five[3]
"ski mask"
=> nil
>> >> => nil
irb e1/ar/aggregation.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> require "pp"
=> ["PP"]
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> #require "rubygems"
?> #require_gem "activerecord"
?> ActiveRecord::Schema.define do
?> create_table :customers, :force => true do |t|
?> t.datetime :created_at
>> t.decimal :credit_limit, :precision => 10, :scale => 2, :default => 100
>> t.string :first_name
>> t.string :initials
>> t.string :last_name
>> t.datetime :last_purchase
>> t.integer :purchase_count, :default => 0
>> end
>> end
-- create_table(:customers, {:force=>true})
-> 0.0734s
=> nil
?> class LastFive
>> attr_reader :list
>> # Takes a string containing "a,b,c" and
?> # stores [ 'a', 'b', 'c' ]
?> def initialize(list_as_string)
>> @list = list_as_string.split(/,/)
>> end
>> # Returns our contents as a
?> # comma delimited string
?> def last_five
>> @list.join(',')
>> end
>> end
=> nil
?> class Purchase < ActiveRecord::Base
>> composed_of :last_five
>> end
=> #<ActiveRecord::Reflection::AggregateReflection:0x7f5d1a9a1e78 @active_record=Purchase(id: integer, name: string, last_five: text), @options={}, @name=:last_five, @macro=:composed_of>
>> Purchase.delete_all
=> 1
?> Purchase.create(:last_five => LastFive.new("3,4,5"))
=> #<Purchase id: 2, name: nil, last_five: "3,4,5">
>> purchase = Purchase.find(:first)
=> #<Purchase id: 2, name: nil, last_five: "3,4,5">
>> puts purchase.last_five.list[1] #=> 4
4
=> nil
?> class Name
>> attr_reader :first, :initials, :last
>> def initialize(first, initials, last)
>> @first = first
>> @initials = initials
>> @last = last
>> end
>> def to_s
>> [ @first, @initials, @last ].compact.join(" ")
>> end
>> end
=> nil
?> class Customer < ActiveRecord::Base
>> composed_of :name,
?> :class_name => "Name",
?> :mapping =>
?> [ # database ruby
?> %w[ first_name first ],
?> %w[ initials initials ],
?> %w[ last_name last ]
>> ]
>> end
=> #<ActiveRecord::Reflection::AggregateReflection:0x7f5d1a8af470 @active_record=Customer(id: integer, created_at: datetime, credit_limit: decimal, first_name: string, initials: string, last_name: string, last_purchase: datetime, purchase_count: integer), @options={:class_name=>"Name", :mapping=>[["first_name", "first"], ["initials", "initials"], ["last_name", "last"]]}, @name=:name, @macro=:composed_of>
>> Customer.delete_all
=> 0
?> name = Name.new("Dwight", "D", "Eisenhower")
=> #<Name:0x7f5d1a88fc10 @initials="D", @first="Dwight", @last="Eisenhower">
>> Customer.create(:credit_limit => 1000, :name => name)
=> #<Customer id: 1, created_at: "2009-03-09 16:32:57", credit_limit: #<BigDecimal:7f5d1a87ad88,'0.1E4',9(18)>, first_name: "Dwight", initials: "D", last_name: "Eisenhower", last_purchase: nil, purchase_count: 0>
>> customer = Customer.find(:first)
=> #<Customer id: 1, created_at: "2009-03-09 16:32:57", credit_limit: #<BigDecimal:7f5d1a874398,'0.1E4',9(18)>, first_name: "Dwight", initials: "D", last_name: "Eisenhower", last_purchase: nil, purchase_count: 0>
>> puts customer.name.first #=> Dwight
Dwight
=> nil
>> puts customer.name.last #=> Eisenhower
Eisenhower
=> nil
>> puts customer.name.to_s #=> Dwight D Eisenhower
Dwight D Eisenhower
=> nil
>> customer.name = Name.new("Harry", nil, "Truman")
=> #<Name:0x7f5d1a8504c0 @initials=nil, @first="Harry", @last="Truman">
>> customer.save
=> true
>> >> => nil
18 ActiveRecord 2
irb e1/ar/associations.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :products, :force => true do |t|
?> t.string :title
>> t.text :description
>> t.string :image_url
>> t.decimal :price, :precision => 10, :scale => 2
>> t.datetime :available_at
>> end
>> create_table :line_items, :force => true do |t|
?> t.integer :product_id
>> t.integer :order_id
>> t.integer :quantity
>> t.integer :unit_price, :precision => 8, :scale => 2
>> end
>> end
-- create_table(:products, {:force=>true})
-> 0.0553s
-- create_table(:line_items, {:force=>true})
-> 0.0260s
=> nil
?> class Product < ActiveRecord::Base
>> has_many :line_items
>> end
=> #<Proc:0x00007f476b7f8258@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:173>
>> class LineItem < ActiveRecord::Base
>> belongs_to :product
>> end
=> #<Proc:0x00007f476b7f69f8@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> LineItem.delete_all
=> 0
>> p = Product.create(:title => "Programming Ruby", :available_at => Time.now)
=> #<Product id: 1, title: "Programming Ruby", description: nil, image_url: nil, price: nil, available_at: "2009-03-09 16:32:57">
>> l = LineItem.new
=> #<LineItem id: nil, product_id: nil, order_id: nil, quantity: nil, unit_price: nil>
>> l.id = 2
=> 2
>> l.product = p
=> #<Product id: 1, title: "Programming Ruby", description: nil, image_url: nil, price: nil, available_at: "2009-03-09 16:32:57">
>> l.save!
=> true
>> l = LineItem.new
=> #<LineItem id: nil, product_id: nil, order_id: nil, quantity: nil, unit_price: nil>
>> l.product = p
=> #<Product id: 1, title: "Programming Ruby", description: nil, image_url: nil, price: nil, available_at: "2009-03-09 16:32:57">
>> l.save!
=> true
>> puts "\n\nSimple Belongs to"
Simple Belongs to
=> nil
?> item = LineItem.find(2)
=> #<LineItem id: 2, product_id: 1, order_id: nil, quantity: nil, unit_price: nil>
>> # item.product is the associated Product object
?> puts "Current product is #{item.product.id}"
Current product is 1
=> nil
>> puts item.product.title
Programming Ruby
=> nil
>> item.product = Product.new(:title => "Rails for Java Developers",
?> :description => "...",
?> :image_url => "http://....jpg",
?> :price => 34.95,
?> :available_at => Time.now)
=> #<Product id: nil, title: "Rails for Java Developers", description: "...", image_url: "http://....jpg", price: #<BigDecimal:7f476a3b2208,'0.3495E2',18(18)>, available_at: "2009-03-09 16:32:57">
>> item.save!
=> true
>> puts "New product is #{item.product.id}"
New product is 2
=> nil
>> puts item.product.title
Rails for Java Developers
=> nil
>> puts "\n\nCreate belongs to"
Create belongs to
=> nil
>> item = LineItem.find(2)
=> #<LineItem id: 2, product_id: 2, order_id: nil, quantity: nil, unit_price: nil>
>> # item.product is the associated Product object
?> puts "Current product is #{item.product.id}"
Current product is 2
=> nil
>> puts item.product.title
Rails for Java Developers
=> nil
?> item.create_product(:title => "Rails Recipes",
?> :description => "...",
?> :image_url => "http://....jpg",
?> :price => 32.95,
?> :available_at => Time.now)
=> #<Product id: 3, title: "Rails Recipes", description: "...", image_url: "http://....jpg", price: #<BigDecimal:7f476a30cd58,'0.3295E2',18(18)>, available_at: "2009-03-09 16:32:57">
>> puts "New product is #{item.product.id}"
New product is 3
=> nil
>> puts item.product.title
Rails Recipes
=> nil
>> puts "\n\nproduct belongs to"
product belongs to
=> nil
>> item = LineItem.find(2)
=> #<LineItem id: 2, product_id: 2, order_id: nil, quantity: nil, unit_price: nil>
>> # item.product is the associated Product object
?> puts "Current product is #{item.product.id}"
Current product is 2
=> nil
>> puts item.product.title
Rails for Java Developers
=> nil
>> item = LineItem.new()
=> #<LineItem id: nil, product_id: nil, order_id: nil, quantity: nil, unit_price: nil>
>> item.create_product(:title => "Advanced Rails",
?> :description => "...",
?> :image_url => "http://....jpg",
?> :price => 34.95,
?> :available_at => Time.now)
=> #<Product id: 4, title: "Advanced Rails", description: "...", image_url: "http://....jpg", price: #<BigDecimal:7f476a261368,'0.3495E2',18(18)>, available_at: "2009-03-09 16:32:57">
>> puts "New product is #{item.product.id}"
New product is 4
=> nil
>> puts item.product.title
Advanced Rails
=> nil
>> item.save!
=> true
>> p item.product(true)
#<Product id: 4, title: "Advanced Rails", description: "...", image_url: "http://....jpg", price: #<BigDecimal:7f476a238580,'0.3495E2',18(18)>, available_at: "2009-03-09 16:32:57">
=> nil
>> puts "============="
=============
=> nil
>> prod = Product.find(item.product_id)
=> #<Product id: 4, title: "Advanced Rails", description: "...", image_url: "http://....jpg", price: #<BigDecimal:7f476a21ed60,'0.3495E2',18(18)>, available_at: "2009-03-09 16:32:57">
>> p prod.line_items.size
1
=> nil
irb e1/ar/sti.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> ActiveRecord::Base.logger = Logger.new(STDOUT)
=> #<Logger:0x7f0428792970 @level=0, @progname=nil, @formatter=nil, @default_formatter=#<Logger::Formatter:0x7f04287928f8 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x7f04287928a8 @dev=#<IO:0x7f042bb3aae8>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x7f0428792858 @mon_entering_queue=[], @mon_count=0, @mon_owner=nil, @mon_waiting_queue=[]>, @shift_size=nil, @filename=nil, @shift_age=nil>>
>> ActiveRecord::Schema.define do
?> create_table :people, :force => true do |t|
?> t.string :type
>> # common attributes
?> t.string :name
>> t.string :email
>> # attributes for type=Customer
?> t.decimal :balance, :precision => 10, :scale => 2
>> # attributes for type=Employee
?> t.integer :reports_to
>> t.integer :dept
>> # attributes for type=Manager
?> # -- none --
?> end
>> end
-- create_table(:people, {:force=>true})
SQL (0.3ms) select sqlite_version(*)
SQL (1.0ms) *[0m SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
*[0m
SQL (18.1ms) CREATE TABLE "people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "email" varchar(255), "balance" decimal(10,2), "reports_to" integer, "dept" integer)
-> 0.0494s
=> nil
?> class Person < ActiveRecord::Base
>> end
=> nil
>> class Customer < Person
>> end
=> nil
>> class Employee < Person
>> belongs_to :boss, :class_name => "Manager", :foreign_key => :reports_to
>> end
=> #<Proc:0x00007f0429b8d920@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> class Manager < Employee
>> end
=> nil
?> Customer.create(:name => 'John Doe', :email => "john@doe.com",
?> :balance => 78.29)
Customer Create (0.4ms) INSERT INTO "people" ("name", "reports_to", "type", "dept", "email", "balance") VALUES('John Doe', NULL, 'Customer', NULL, 'john@doe.com', 78.29)
=> #<Customer id: 1, type: "Customer", name: "John Doe", email: "john@doe.com", balance: #<BigDecimal:7f0428915f40,'0.7829E2',18(18)>, reports_to: nil, dept: nil>
>> wilma = Manager.create(:name => 'Wilma Flint', :email => "wilma@here.com",
?> :dept => 23)
Manager Create (0.3ms) INSERT INTO "people" ("name", "reports_to", "type", "dept", "email", "balance") VALUES('Wilma Flint', NULL, 'Manager', 23, 'wilma@here.com', NULL)
=> #<Manager id: 2, type: "Manager", name: "Wilma Flint", email: "wilma@here.com", balance: nil, reports_to: nil, dept: 23>
>> Customer.create(:name => 'Bert Public', :email => "b@public.net",
?> :balance => 12.45)
Customer Create (0.3ms) INSERT INTO "people" ("name", "reports_to", "type", "dept", "email", "balance") VALUES('Bert Public', NULL, 'Customer', NULL, 'b@public.net', 12.45)
=> #<Customer id: 3, type: "Customer", name: "Bert Public", email: "b@public.net", balance: #<BigDecimal:7f0428837ee8,'0.1245E2',18(18)>, reports_to: nil, dept: nil>
>> barney = Employee.new(:name => 'Barney Rub', :email => "barney@here.com",
?> :dept => 23)
=> #<Employee id: nil, type: "Employee", name: "Barney Rub", email: "barney@here.com", balance: nil, reports_to: nil, dept: 23>
>> barney.boss = wilma
=> #<Manager id: 2, type: "Manager", name: "Wilma Flint", email: "wilma@here.com", balance: nil, reports_to: nil, dept: 23>
>> barney.save!
Employee Create (0.3ms) INSERT INTO "people" ("name", "reports_to", "type", "dept", "email", "balance") VALUES('Barney Rub', 2, 'Employee', 23, 'barney@here.com', NULL)
=> true
>> manager = Person.find_by_name("Wilma Flint")
Person Load (0.4ms) SELECT * FROM "people" WHERE ("people"."name" = 'Wilma Flint') LIMIT 1
=> #<Manager id: 2, type: "Manager", name: "Wilma Flint", email: "wilma@here.com", balance: nil, reports_to: nil, dept: 23>
>> puts manager.class #=> Manager
Manager
=> nil
>> puts manager.email #=> wilma@here.com
wilma@here.com
=> nil
>> puts manager.dept #=> 23
23
=> nil
>> customer = Person.find_by_name("Bert Public")
Person Load (0.4ms) SELECT * FROM "people" WHERE ("people"."name" = 'Bert Public') LIMIT 1
=> #<Customer id: 3, type: "Customer", name: "Bert Public", email: "b@public.net", balance: #<BigDecimal:7f0428746980,'0.1245E2',18(18)>, reports_to: nil, dept: nil>
>> puts customer.class #=> Customer
Customer
=> nil
>> puts customer.email #=> b@public.net
b@public.net
=> nil
>> puts customer.balance #=> 12.45
12.45
=> nil
>> b = Person.find_by_name("Barney Rub")
Person Load (0.4ms) SELECT * FROM "people" WHERE ("people"."name" = 'Barney Rub') LIMIT 1
=> #<Employee id: 4, type: "Employee", name: "Barney Rub", email: "barney@here.com", balance: nil, reports_to: 2, dept: 23>
>> p b.boss
Manager Load (0.4ms) SELECT * FROM "people" WHERE ("people"."id" = 2) AND ( ("people"."type" = 'Manager' ) )
#<Manager id: 2, type: "Manager", name: "Wilma Flint", email: "wilma@here.com", balance: nil, reports_to: nil, dept: 23>
=> nil
irb e1/ar/polymorphic.rb 1
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> if ARGV.empty? or ARGV.first == '1'
>> ActiveRecord::Schema.define do
?> create_table :catalog_entries, :force => true do |t|
?> t.string :name
>> t.datetime :acquired_at
>> t.integer :resource_id
>> t.string :resource_type
>> end
?> create_table :articles, :force => true do |t|
?> t.text :content
>> end
>> create_table :sounds, :force => true do |t|
?> t.binary :content
>> end
>> create_table :images, :force => true do |t|
?> t.binary :content
>> end
>> end
>> end
-- create_table(:catalog_entries, {:force=>true})
-> 0.0439s
-- create_table(:articles, {:force=>true})
-> 0.0139s
-- create_table(:sounds, {:force=>true})
-> 0.0135s
-- create_table(:images, {:force=>true})
-> 0.0151s
=> nil
?> class CatalogEntry < ActiveRecord::Base
>> belongs_to :resource, :polymorphic => true
>> end
=> #<Proc:0x00007f32144bd9b0@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
?> class Article < ActiveRecord::Base
>> has_one :catalog_entry, :as => :resource
>> end
=> #<Proc:0x00007f32144bd9b0@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> class Sound < ActiveRecord::Base
>> has_one :catalog_entry, :as => :resource
>> end
=> #<Proc:0x00007f32144bd9b0@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> class Image < ActiveRecord::Base
>> has_one :catalog_entry, :as => :resource
>> end
=> #<Proc:0x00007f32144bd9b0@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> case ARGV.shift
>> when "1"
>> a = Article.new(:content => "This is my new article")
>> c = CatalogEntry.new(:name => 'Article One', :acquired_at => Time.now)
>> c.resource = a
>> c.save!
?> article = Article.find(1)
>> p article.catalog_entry.name #=> "Article One"
>> cat = CatalogEntry.find(1)
>> resource = cat.resource
>> p resource #=> #<Article:0x640d80 @attributes={"id"=>"1",
>> # "content"=>"This is my new article"}>
?> when "2"
>> c = CatalogEntry.new(:name => 'Article One', :acquired_at => Time.now)
>> c.resource = Article.new(:content => "This is my new article")
>> c.save!
>> c = CatalogEntry.new(:name => 'Image One', :acquired_at => Time.now)
>> c.resource = Image.new(:content => "some binary data")
>> c.save!
>> c = CatalogEntry.new(:name => 'Sound One', :acquired_at => Time.now)
>> c.resource = Sound.new(:content => "more binary data")
>> c.save!
?> CatalogEntry.find(:all).each do |c|
?> puts "#{c.name}: #{c.resource.class}"
>> end
>> else
?> a = Sound.new(:content => "ding!")
>> c = CatalogEntry.new(:name => 'Sound One', :acquired_at => Time.now)
>> c.resource = a
>> c.save!
>> c = CatalogEntry.find 1
>> p c.resource
>> a = Sound.find :first
>> p a.catalog_entry
>> end
"Article One"
#<Article id: 1, content: "This is my new article">
=> nil
sqlite3> select * from articles
id = 1
content = This is my new article
sqlite3> select * from catalog_entries
id = 1
name = Article One
acquired_at = 2009-03-09 16:32:58
resource_id = 1
resource_type = Article
sqlite3> delete from catalog_entries
irb e1/ar/polymorphic.rb 2
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> if ARGV.empty? or ARGV.first == '1'
>> ActiveRecord::Schema.define do
?> create_table :catalog_entries, :force => true do |t|
?> t.string :name
>> t.datetime :acquired_at
>> t.integer :resource_id
>> t.string :resource_type
>> end
?> create_table :articles, :force => true do |t|
?> t.text :content
>> end
>> create_table :sounds, :force => true do |t|
?> t.binary :content
>> end
>> create_table :images, :force => true do |t|
?> t.binary :content
>> end
>> end
>> end
=> nil
?> class CatalogEntry < ActiveRecord::Base
>> belongs_to :resource, :polymorphic => true
>> end
=> #<Proc:0x00007f644113e9b0@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
?> class Article < ActiveRecord::Base
>> has_one :catalog_entry, :as => :resource
>> end
=> #<Proc:0x00007f644113e9b0@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> class Sound < ActiveRecord::Base
>> has_one :catalog_entry, :as => :resource
>> end
=> #<Proc:0x00007f644113e9b0@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> class Image < ActiveRecord::Base
>> has_one :catalog_entry, :as => :resource
>> end
=> #<Proc:0x00007f644113e9b0@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> case ARGV.shift
>> when "1"
>> a = Article.new(:content => "This is my new article")
>> c = CatalogEntry.new(:name => 'Article One', :acquired_at => Time.now)
>> c.resource = a
>> c.save!
?> article = Article.find(1)
>> p article.catalog_entry.name #=> "Article One"
>> cat = CatalogEntry.find(1)
>> resource = cat.resource
>> p resource #=> #<Article:0x640d80 @attributes={"id"=>"1",
>> # "content"=>"This is my new article"}>
?> when "2"
>> c = CatalogEntry.new(:name => 'Article One', :acquired_at => Time.now)
>> c.resource = Article.new(:content => "This is my new article")
>> c.save!
>> c = CatalogEntry.new(:name => 'Image One', :acquired_at => Time.now)
>> c.resource = Image.new(:content => "some binary data")
>> c.save!
>> c = CatalogEntry.new(:name => 'Sound One', :acquired_at => Time.now)
>> c.resource = Sound.new(:content => "more binary data")
>> c.save!
?> CatalogEntry.find(:all).each do |c|
?> puts "#{c.name}: #{c.resource.class}"
>> end
>> else
?> a = Sound.new(:content => "ding!")
>> c = CatalogEntry.new(:name => 'Sound One', :acquired_at => Time.now)
>> c.resource = a
>> c.save!
>> c = CatalogEntry.find 1
>> p c.resource
>> a = Sound.find :first
>> p a.catalog_entry
>> end
Article One: Article
Image One: Image
Sound One: Sound
=> [#<CatalogEntry id: 2, name: "Article One", acquired_at: "2009-03-09 16:32:59", resource_id: 2, resource_type: "Article">, #<CatalogEntry id: 3, name: "Image One", acquired_at: "2009-03-09 16:32:59", resource_id: 1, resource_type: "Image">, #<CatalogEntry id: 4, name: "Sound One", acquired_at: "2009-03-09 16:32:59", resource_id: 1, resource_type: "Sound">]
sqlite3> select * from articles
id = 1
content = This is my new article
id = 2
content = This is my new article
sqlite3> select * from images
id = 1
content = some binary data
sqlite3> select * from sounds
id = 1
content = more binary data
sqlite3> select * from catalog_entries
id = 2
name = Article One
acquired_at = 2009-03-09 16:32:59
resource_id = 2
resource_type = Article
id = 3
name = Image One
acquired_at = 2009-03-09 16:32:59
resource_id = 1
resource_type = Image
id = 4
name = Sound One
acquired_at = 2009-03-09 16:32:59
resource_id = 1
resource_type = Sound
irb e1/ar/self_association.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :employees, :force => true do |t|
?> t.string :name
>> t.integer :manager_id
>> t.integer :mentor_id
>> end
>> end
-- create_table(:employees, {:force=>true})
-> 0.0389s
=> nil
?> class Employee < ActiveRecord::Base
>> belongs_to :manager,
?> :class_name => "Employee",
?> :foreign_key => "manager_id"
>> belongs_to :mentor,
?> :class_name => "Employee",
?> :foreign_key => "mentor_id"
>> has_many :mentored_employees,
?> :class_name => "Employee",
?> :foreign_key => "mentor_id"
>> has_many :managed_employees,
?> :class_name => "Employee",
?> :foreign_key => "manager_id"
>> end
=> #<Proc:0x00007fe6d5ac4220@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:173>
?> Employee.delete_all
=> 0
>> adam = Employee.create(:name => "Adam")
=> #<Employee id: 1, name: "Adam", manager_id: nil, mentor_id: nil>
>> beth = Employee.create(:name => "Beth")
=> #<Employee id: 2, name: "Beth", manager_id: nil, mentor_id: nil>
>> clem = Employee.new(:name => "Clem")
=> #<Employee id: nil, name: "Clem", manager_id: nil, mentor_id: nil>
>> clem.manager = adam
=> #<Employee id: 1, name: "Adam", manager_id: nil, mentor_id: nil>
>> clem.mentor = beth
=> #<Employee id: 2, name: "Beth", manager_id: nil, mentor_id: nil>
>> clem.save!
=> true
>> dawn = Employee.new(:name => "Dawn")
=> #<Employee id: nil, name: "Dawn", manager_id: nil, mentor_id: nil>
>> dawn.manager = adam
=> #<Employee id: 1, name: "Adam", manager_id: nil, mentor_id: nil>
>> dawn.mentor = clem
=> #<Employee id: 3, name: "Clem", manager_id: 1, mentor_id: 2>
>> dawn.save!
=> true
?> p adam.managed_employees.map {|e| e.name} # => [ "Clem", "Dawn" ]
["Clem", "Dawn"]
=> nil
>> p adam.mentored_employees # => []
[]
=> nil
>> p dawn.mentor.name # => "Clem"
"Clem"
=> nil
>> >> => nil
irb e1/ar/acts_as_list.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "logger"
=> true
>> require "rubygems"
=> false
>> require "activerecord"
=> true
>> require "vendor/plugins/acts_as_list/init"
=> []
>> require "connect"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> ActiveRecord::Base.connection.instance_eval do
?> create_table :parents, :force => true do |t|
?> end
>> create_table :children, :force => true do |t|
?> t.integer :parent_id
>> t.string :name
>> t.integer :position
>> end
>> end
=> []
?> class Parent < ActiveRecord::Base
>> has_many :children, :order => :position
>> end
=> #<Proc:0x00007fa5aaaac790@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:173>
>> class Child < ActiveRecord::Base
>> belongs_to :parent
>> acts_as_list :scope => :parent
>> end
=> [#<ActiveSupport::Callbacks::Callback:0x7fa5aaa13248 @identifier=nil, @kind=:before_create, @method=:add_to_list_bottom, @options={}>]
?> parent = Parent.create
=> #<Parent id: 1>
>> %w{ One Two Three Four}.each do |name|
?> parent.children.create(:name => name)
>> end
=> ["One", "Two", "Three", "Four"]
>> parent.save
=> true
?> def display_children(parent)
>> puts parent.children(true).map {|child| child.name }.join(", ")
>> end
=> nil
?> display_children(parent) #=> One, Two, Three, Four
One, Two, Three, Four
=> nil
>> puts parent.children[0].first? #=> true
true
=> nil
>> two = parent.children[1]
=> #<Child id: 2, parent_id: 1, name: "Two", position: 2>
>> puts two.lower_item.name #=> Three
Three
=> nil
>> puts two.higher_item.name #=> One
One
=> nil
>> parent.children[0].move_lower
=> true
>> display_children(parent) #=> Two, One, Three, Four
Two, One, Three, Four
=> nil
>> parent.children[2].move_to_top
=> true
>> display_children(parent) #=> Three, Two, One, Four
Three, Two, One, Four
=> nil
>> parent.children[2].destroy
=> #<Child id: 1, parent_id: 1, name: "One", position: nil>
>> display_children(parent) #=> Three, Two, Four
Three, Two, Four
=> nil
>> >> => nil
irb e1/ar/acts_as_tree.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> require "rubygems"
=> []
>> require "activerecord"
=> []
>> require "vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb"
=> []
>> require "vendor/plugins/acts_as_tree/init"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> ActiveRecord::Schema.define do
?> create_table :categories, :force => true do |t|
?> t.string :name
>> t.integer :parent_id
>> end
>> end
-- create_table(:categories, {:force=>true})
-> 0.0514s
=> nil
?> class Category < ActiveRecord::Base
>> acts_as_tree :order => "name"
>> end
=> nil
?> root = Category.create(:name => "Books")
=> #<Category id: 1, name: "Books", parent_id: nil>
>> fiction = root.children.create(:name => "Fiction")
=> #<Category id: 2, name: "Fiction", parent_id: 1>
>> non_fiction = root.children.create(:name => "Non Fiction")
=> #<Category id: 3, name: "Non Fiction", parent_id: 1>
>> non_fiction.children.create(:name => "Computers")
=> #<Category id: 4, name: "Computers", parent_id: 3>
>> non_fiction.children.create(:name => "Science")
=> #<Category id: 5, name: "Science", parent_id: 3>
>> non_fiction.children.create(:name => "Art History")
=> #<Category id: 6, name: "Art History", parent_id: 3>
>> fiction.children.create(:name => "Mystery")
=> #<Category id: 7, name: "Mystery", parent_id: 2>
>> fiction.children.create(:name => "Romance")
=> #<Category id: 8, name: "Romance", parent_id: 2>
>> fiction.children.create(:name => "Science Fiction")
=> #<Category id: 9, name: "Science Fiction", parent_id: 2>
>> def display_children(order)
>> puts order.children.map {|child| child.name }.join(", ")
>> end
=> nil
?> display_children(root) # Fiction, Non Fiction
Fiction, Non Fiction
=> nil
>> sub_category = root.children.first
=> #<Category id: 2, name: "Fiction", parent_id: 1>
>> puts sub_category.children.size #=> 3
3
=> nil
>> display_children(sub_category) #=> Mystery, Romance, Science Fiction
Mystery, Romance, Science Fiction
=> nil
>> non_fiction = root.children.find(:first, :conditions => "name = 'Non Fiction'")
=> #<Category id: 3, name: "Non Fiction", parent_id: 1>
>> display_children(non_fiction) #=> Art History, Computers, Science
Art History, Computers, Science
=> nil
>> puts non_fiction.parent.name #=> Books
Books
=> nil
>> >> => nil
irb e1/ar/one_to_one.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :invoices, :force => true do |t|
?> t.integer :order_id
>> end
>> create_table :orders, :force => true do |t|
?> t.string :name
>> t.string :email
>> t.text :address
>> t.string :pay_type
>> t.datetime :shipped_at
>> end
>> end
-- create_table(:invoices, {:force=>true})
-> 0.0449s
-- create_table(:orders, {:force=>true})
-> 0.0307s
=> nil
?> class Order < ActiveRecord::Base
>> has_one :invoice
>> end
=> #<Proc:0x00007f64764af920@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> class Invoice < ActiveRecord::Base
>> belongs_to :order
>> end
=> #<Proc:0x00007f64764af920@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
>> Order.create(:name => "Dave", :email => "dave@xxx",
?> :address => "123 Main St", :pay_type => "credit",
?> :shipped_at => Time.now)
=> #<Order id: 1, name: "Dave", email: "dave@xxx", address: "123 Main St", pay_type: "credit", shipped_at: "2009-03-09 16:33:02">
>> order = Order.find(1)
=> #<Order id: 1, name: "Dave", email: "dave@xxx", address: "123 Main St", pay_type: "credit", shipped_at: "2009-03-09 16:33:02">
>> p order.invoice
nil
=> nil
>> invoice = Invoice.new
=> #<Invoice id: nil, order_id: nil>
>> if invoice.save
>> order.invoice = invoice
>> else
?> fail invoice.errors.to_s
>> end
=> #<Invoice id: 1, order_id: 1>
>> p order.invoice
#<Invoice id: 1, order_id: 1>
=> nil
>> o = Order.new
=> #<Order id: nil, name: nil, email: nil, address: nil, pay_type: nil, shipped_at: nil>
>> p o.id
nil
=> nil
>> invoice.order = o
=> #<Order id: nil, name: nil, email: nil, address: nil, pay_type: nil, shipped_at: nil>
>> p o.id
nil
=> nil
>> invoice.save
=> true
>> p o.id
2
=> nil
irb e1/ar/counters.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :products, :force => true do |t|
?> t.string :title
>> t.text :description
>> # ...
?> t.integer :line_items_count, :default => 0
>> end
>> create_table :line_items, :force => true do |t|
?> t.integer :product_id
>> t.integer :order_id
>> t.integer :quantity
>> t.decimal :unit_price, :precision => 8, :scale => 2
>> end
>> end
-- create_table(:products, {:force=>true})
-> 0.0690s
-- create_table(:line_items, {:force=>true})
-> 0.0222s
=> nil
>> class Product < ActiveRecord::Base
>> has_many :line_items
>> end
=> #<Proc:0x00007ffebc00f218@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:173>
?> class LineItem < ActiveRecord::Base
>> belongs_to :product, :counter_cache => true
>> end
=> #<Proc:0x00007ffebc00d990@/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/autosave_association.rb:183>
?> product = Product.create(:title => "Programming Ruby",
?> :description => " ... ")
=> #<Product id: 1, title: "Programming Ruby", description: " ... ", line_items_count: 0>
>> line_item = LineItem.new
=> #<LineItem id: nil, product_id: nil, order_id: nil, quantity: nil, unit_price: nil>
>> line_item.product = product
=> #<Product id: 1, title: "Programming Ruby", description: " ... ", line_items_count: 0>
>> line_item.save
=> true
>> puts "In memory size = #{product.line_items.size}" #=> 0
In memory size = 0
=> nil
>> puts "Refreshed size = #{product.line_items(:refresh).size}" #=> 1
Refreshed size = 1
=> nil
>> LineItem.delete_all
=> 1
>> Product.delete_all
=> 1
?> product = Product.create(:title => "Programming Ruby",
?> :description => " ... ")
=> #<Product id: 2, title: "Programming Ruby", description: " ... ", line_items_count: 0>
>> product.line_items.create
=> #<LineItem id: 2, product_id: 2, order_id: nil, quantity: nil, unit_price: nil>
>> puts "In memory size = #{product.line_items.size}" #=> 1
In memory size = 0
=> nil
>> puts "Refreshed size = #{product.line_items(:refresh).size}" #=> 1
Refreshed size = 1
=> nil
>> >> => nil
19 ActiveRecord 3
irb e1/ar/encrypt.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "rubygems"
=> false
>> gem "activerecord"
=> true
>> require "connect"
=> true
>> ActiveRecord::Schema.define do
?> create_table :orders, :force => true do |t|
?> t.integer :user_id
>> t.string :name
>> t.string :address
>> t.string :email
>> end
>> create_table :users, :force => :true do |t|
?> t.string :name
>> end
>> end
-- create_table(:orders, {:force=>true})
-> 0.0697s
-- create_table(:users, {:force=>:true})
-> 0.0268s
=> nil
?> class ActiveRecord::Base
>> def self.encrypt(*attr_names)
>> encrypter = Encrypter.new(attr_names)
>> before_save encrypter
>> after_save encrypter
>> after_find encrypter
>> define_method(:after_find) { }
>> end
>> end
=> nil
?> class Encrypter
>> # We're passed a list of attributes that should
?> # be stored encrypted in the database
?> def initialize(attrs_to_manage)
>> @attrs_to_manage = attrs_to_manage
>> end
>> # Before saving or updating, encrypt the fields using the NSA and
?> # DHS approved Shift Cipher
?> def before_save(model)
>> @attrs_to_manage.each do |field|
?> model[field].tr!("a-z", "b-za")
>> end
>> end
>> # After saving, decrypt them back
?> def after_save(model)
>> @attrs_to_manage.each do |field|
?> model[field].tr!("b-za", "a-z")
>> end
>> end
>> # Do the same after finding an existing record
?> alias_method :after_find, :after_save
>> end
=> Encrypter
?> class Order < ActiveRecord::Base
>> encrypt(:name, :email)
>> end
=> #<Proc:0x0000000000000000@../../code/e1/ar/encrypt.rb:34>
?> o = Order.new
=> #<Order id: nil, user_id: nil, name: nil, address: nil, email: nil>
>> o.name = "Dave Thomas"
=> "Dave Thomas"
>> o.address = "123 The Street"
=> "123 The Street"
>> o.email = "dave@pragprog.com"
=> "dave@pragprog.com"
>> o.save
=> true
>> puts o.name
Dave Thomas
=> nil
>> o = Order.find(o.id)
=> #<Order id: 1, user_id: nil, name: "Dave Thomas", address: "123 The Street", email: "dave@pragprog.com">
>> puts o.name
Dave Thomas
=> nil
>> >> => nil
sqlite3> select * from orders
id = 1
user_id =
name = Dbwf Tipnbt
address = 123 The Street
email = ebwf@qsbhqsph.dpn
irb e1/ar/observer.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "rubygems"
=> false
>> require "activerecord"
=> true
>> require 'connect'
=> []
>> ActiveRecord::Base.logger = Logger.new(STDOUT)
=> #<Logger:0x7f4f271a6c88 @level=0, @progname=nil, @formatter=nil, @default_formatter=#<Logger::Formatter:0x7f4f271a6c38 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x7f4f271a6be8 @mutex=#<Logger::LogDevice::LogDeviceMutex:0x7f4f271a6b98 @mon_count=0, @mon_owner=nil, @mon_waiting_queue=[], @mon_entering_queue=[]>, @shift_size=nil, @filename=nil, @shift_age=nil, @dev=#<IO:0x7f4f2a55cac8>>>
>> ActiveRecord::Schema.define do
?> create_table :payments, :force => true do |t|
?> end
>> end
-- create_table(:payments, {:force=>true})
SQL (0.3ms) select sqlite_version(*)
SQL (1.3ms) *[0m SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
*[0m
SQL (17.2ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)
-> 0.0505s
=> nil
>> class Order < ActiveRecord::Base
>> end
=> nil
>> class Payment < ActiveRecord::Base
>> end
=> nil
>> class Refund < ActiveRecord::Base
>> end
=> nil
?> class OrderObserver < ActiveRecord::Observer
>> def after_save(an_order)
>> an_order.logger.info("Order #{an_order.id} created")
>> end
>> end
=> nil
>> OrderObserver.instance
=> #<OrderObserver:0x7f4f26f8c538>
?> class AuditObserver < ActiveRecord::Observer
>> observe Order, Payment, Refund
>> def after_save(model)
>> model.logger.info("[Audit] #{model.class.name} #{model.id} created")
>> end
>> end
=> nil
>> AuditObserver.instance
=> #<AuditObserver:0x7f4f285dec50>
>> o = Order.create
Order Create (0.3ms) INSERT INTO "orders" ("name", "address", "user_id", "email") VALUES(NULL, NULL, NULL, NULL)
Order 2 created
[Audit] Order 2 created
=> #<Order id: 2, user_id: nil, name: nil, address: nil, email: nil>
>> p = Payment.create
Payment Create (0.2ms) INSERT INTO payments VALUES(NULL)
[Audit] Payment 1 created
=> #<Payment id: 1>
?> >>
irb e1/ar/attributes.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> require "pp"
=> ["PP"]
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> class LineItem < ActiveRecord::Base
>> end
=> nil
>> LineItem.delete_all
=> 1
>> LineItem.create(:quantity => 1, :product_id => 27, :order_id => 13, :unit_price => 29.95)
=> #<LineItem id: 3, product_id: 27, order_id: 13, quantity: 1, unit_price: #<BigDecimal:7f3a3d455cf8,'0.2995E2',18(18)>>
>> LineItem.create(:quantity => 2, :unit_price => 29.95)
=> #<LineItem id: 4, product_id: nil, order_id: nil, quantity: 2, unit_price: #<BigDecimal:7f3a3d427790,'0.2995E2',18(18)>>
>> LineItem.create(:quantity => 1, :unit_price => 44.95)
=> #<LineItem id: 5, product_id: nil, order_id: nil, quantity: 1, unit_price: #<BigDecimal:7f3a3d3f5128,'0.4495E2',18(18)>>
>> result = LineItem.find(:first)
=> #<LineItem id: 3, product_id: 27, order_id: 13, quantity: 1, unit_price: #<BigDecimal:7f3a3d3d49c8,'0.2995E2',18(18)>>
>> p result.quantity
1
=> nil
>> p result.unit_price
#<BigDecimal:7f3a3d3b49e8,'0.2995E2',18(18)>
=> nil
>> result = LineItem.find_by_sql("select quantity, quantity*unit_price " +
?> "from line_items")
=> [#<LineItem quantity: 1>, #<LineItem quantity: 2>, #<LineItem quantity: 1>]
>> pp result[0].attributes
{"quantity*unit_price"=>"29.95", "quantity"=>1}
=> nil
>> result = LineItem.find_by_sql("select quantity,
quantity*unit_price as total_price " +
?> "from line_items")
=> [#<LineItem quantity: 1>, #<LineItem quantity: 2>, #<LineItem quantity: 1>]
>> pp result[0].attributes
{"quantity"=>1, "total_price"=>"29.95"}
=> nil
>> p result[0].total_price
"29.95"
=> nil
>> sales_tax = 0.07
=> 0.07
>> p result[0].total_price * sales_tax
""
=> nil
>> class LineItem < ActiveRecord::Base
>> def total_price
>> Float(read_attribute("total_price"))
>> end
>> CUBITS_TO_INCHES = 2.54
>> def quantity
>> read_attribute("quantity") * CUBITS_TO_INCHES
>> end
>> def quantity=(inches)
>> write_attribute("quantity", Float(inches) / CUBITS_TO_INCHES)
>> end
>> end
=> nil
>> p result[0].quantity
2.54
=> nil
>> result[0].quantity = 500
=> 500
>> p result[0].save
true
=> nil
?> >>
sqlite3> select id, quantity*unit_price from line_items
id = 3
quantity*unit_price = 29.95
id = 4
quantity*unit_price = 59.9
id = 5
quantity*unit_price = 44.95
irb e1/ar/transactions.rb 1
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :accounts, :force => true do |t|
?> t.string :number
>> t.decimal :balance, :precision => 10, :scale => 2, :default => 0
>> end
>> end
-- create_table(:accounts, {:force=>true})
-> 0.0623s
=> nil
?> class Account < ActiveRecord::Base
>> def self.transfer(from, to, amount)
>> transaction(from, to) do
?> from.withdraw(amount)
>> to.deposit(amount)
>> end
>> end
?> def withdraw(amount)
>> adjust_balance_and_save(-amount)
>> end
>> def deposit(amount)
>> adjust_balance_and_save(amount)
>> end
>> private
>> def adjust_balance_and_save(amount)
>> self.balance += amount
>> save!
>> end
>> def validate # validation is called by Active Record
>> errors.add(:balance, "is negative") if balance < 0
>> end
>> end
=> nil
?> def adjust_balance_and_save(amount)
>> self.balance += amount
>> end
=> nil
?> peter = Account.create(:balance => 100, :number => "12345")
=> #<Account id: 1, number: "12345", balance: #<BigDecimal:7f6f2ee2d688,'0.1E3',9(18)>>
>> paul = Account.create(:balance => 200, :number => "54321")
=> #<Account id: 2, number: "54321", balance: #<BigDecimal:7f6f2edf0c88,'0.2E3',9(18)>>
>> case ARGV[0] || "1"
>> when "1"
>> Account.transaction do
?> paul.deposit(10)
>> peter.withdraw(10)
>> end
>> when "2"
>> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> when "3"
>> begin
?> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "4"
>> begin
?> Account.transaction(peter, paul) do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "5"
>> Account.transfer(peter, paul, 350) rescue puts "Transfer aborted"
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> end
=> true
>> >> => nil
sqlite3> select * from accounts
id = 1
number = 12345
balance = 90
id = 2
number = 54321
balance = 210
irb e1/ar/transactions.rb 2
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :accounts, :force => true do |t|
?> t.string :number
>> t.decimal :balance, :precision => 10, :scale => 2, :default => 0
>> end
>> end
-- create_table(:accounts, {:force=>true})
-> 0.0650s
=> nil
?> class Account < ActiveRecord::Base
>> def self.transfer(from, to, amount)
>> transaction(from, to) do
?> from.withdraw(amount)
>> to.deposit(amount)
>> end
>> end
?> def withdraw(amount)
>> adjust_balance_and_save(-amount)
>> end
>> def deposit(amount)
>> adjust_balance_and_save(amount)
>> end
>> private
>> def adjust_balance_and_save(amount)
>> self.balance += amount
>> save!
>> end
>> def validate # validation is called by Active Record
>> errors.add(:balance, "is negative") if balance < 0
>> end
>> end
=> nil
?> def adjust_balance_and_save(amount)
>> self.balance += amount
>> end
=> nil
?> peter = Account.create(:balance => 100, :number => "12345")
=> #<Account id: 1, number: "12345", balance: #<BigDecimal:7f253e267748,'0.1E3',9(18)>>
>> paul = Account.create(:balance => 200, :number => "54321")
=> #<Account id: 2, number: "54321", balance: #<BigDecimal:7f253e236918,'0.2E3',9(18)>>
>> case ARGV[0] || "1"
>> when "1"
>> Account.transaction do
?> paul.deposit(10)
>> peter.withdraw(10)
>> end
>> when "2"
>> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> when "3"
>> begin
?> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "4"
>> begin
?> Account.transaction(peter, paul) do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "5"
>> Account.transfer(peter, paul, 350) rescue puts "Transfer aborted"
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> end
ActiveRecord::RecordInvalid: Validation failed: Balance is negative
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/validations.rb:1021:in `save_without_dirty!'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/dirty.rb:87:in `save_without_transactions!'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:200:in `save!'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:182:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:200:in `save!'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:200:in `save!'
from ../../code/e1/ar/transactions.rb:46:in `adjust_balance_and_save'
from ../../code/e1/ar/transactions.rb:35:in `withdraw'
from ../../code/e1/ar/transactions.rb:82
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:182:in `transaction'
from ../../code/e1/ar/transactions.rb:80
from :0
>> >> => nil
sqlite3> select * from accounts
id = 1
number = 12345
balance = 100
id = 2
number = 54321
balance = 200
irb e1/ar/transactions.rb 3
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :accounts, :force => true do |t|
?> t.string :number
>> t.decimal :balance, :precision => 10, :scale => 2, :default => 0
>> end
>> end
-- create_table(:accounts, {:force=>true})
-> 0.0553s
=> nil
?> class Account < ActiveRecord::Base
>> def self.transfer(from, to, amount)
>> transaction(from, to) do
?> from.withdraw(amount)
>> to.deposit(amount)
>> end
>> end
?> def withdraw(amount)
>> adjust_balance_and_save(-amount)
>> end
>> def deposit(amount)
>> adjust_balance_and_save(amount)
>> end
>> private
>> def adjust_balance_and_save(amount)
>> self.balance += amount
>> save!
>> end
>> def validate # validation is called by Active Record
>> errors.add(:balance, "is negative") if balance < 0
>> end
>> end
=> nil
?> def adjust_balance_and_save(amount)
>> self.balance += amount
>> end
=> nil
?> peter = Account.create(:balance => 100, :number => "12345")
=> #<Account id: 1, number: "12345", balance: #<BigDecimal:7ffbf7a56db0,'0.1E3',9(18)>>
>> paul = Account.create(:balance => 200, :number => "54321")
=> #<Account id: 2, number: "54321", balance: #<BigDecimal:7ffbf7a1a248,'0.2E3',9(18)>>
>> case ARGV[0] || "1"
>> when "1"
>> Account.transaction do
?> paul.deposit(10)
>> peter.withdraw(10)
>> end
>> when "2"
>> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> when "3"
>> begin
?> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "4"
>> begin
?> Account.transaction(peter, paul) do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "5"
>> Account.transfer(peter, paul, 350) rescue puts "Transfer aborted"
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> end
Transfer aborted
Paul has 550.0
Peter has -250.0
=> nil
>> >> => nil
irb e1/ar/transactions.rb 4
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :accounts, :force => true do |t|
?> t.string :number
>> t.decimal :balance, :precision => 10, :scale => 2, :default => 0
>> end
>> end
-- create_table(:accounts, {:force=>true})
-> 0.0662s
=> nil
?> class Account < ActiveRecord::Base
>> def self.transfer(from, to, amount)
>> transaction(from, to) do
?> from.withdraw(amount)
>> to.deposit(amount)
>> end
>> end
?> def withdraw(amount)
>> adjust_balance_and_save(-amount)
>> end
>> def deposit(amount)
>> adjust_balance_and_save(amount)
>> end
>> private
>> def adjust_balance_and_save(amount)
>> self.balance += amount
>> save!
>> end
>> def validate # validation is called by Active Record
>> errors.add(:balance, "is negative") if balance < 0
>> end
>> end
=> nil
?> def adjust_balance_and_save(amount)
>> self.balance += amount
>> end
=> nil
?> peter = Account.create(:balance => 100, :number => "12345")
=> #<Account id: 1, number: "12345", balance: #<BigDecimal:7fde8ebd1c70,'0.1E3',9(18)>>
>> paul = Account.create(:balance => 200, :number => "54321")
=> #<Account id: 2, number: "54321", balance: #<BigDecimal:7fde8eb92728,'0.2E3',9(18)>>
>> case ARGV[0] || "1"
>> when "1"
>> Account.transaction do
?> paul.deposit(10)
>> peter.withdraw(10)
>> end
>> when "2"
>> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> when "3"
>> begin
?> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "4"
>> begin
?> Account.transaction(peter, paul) do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "5"
>> Account.transfer(peter, paul, 350) rescue puts "Transfer aborted"
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> end
Transfer aborted
Paul has 200.0
Peter has 100.0
=> nil
>> >> => nil
irb e1/ar/transactions.rb 5
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "logger"
=> []
>> #ActiveRecord::Base.logger = Logger.new(STDOUT)
?> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :accounts, :force => true do |t|
?> t.string :number
>> t.decimal :balance, :precision => 10, :scale => 2, :default => 0
>> end
>> end
-- create_table(:accounts, {:force=>true})
-> 0.0701s
=> nil
?> class Account < ActiveRecord::Base
>> def self.transfer(from, to, amount)
>> transaction(from, to) do
?> from.withdraw(amount)
>> to.deposit(amount)
>> end
>> end
?> def withdraw(amount)
>> adjust_balance_and_save(-amount)
>> end
>> def deposit(amount)
>> adjust_balance_and_save(amount)
>> end
>> private
>> def adjust_balance_and_save(amount)
>> self.balance += amount
>> save!
>> end
>> def validate # validation is called by Active Record
>> errors.add(:balance, "is negative") if balance < 0
>> end
>> end
=> nil
?> def adjust_balance_and_save(amount)
>> self.balance += amount
>> end
=> nil
?> peter = Account.create(:balance => 100, :number => "12345")
=> #<Account id: 1, number: "12345", balance: #<BigDecimal:7f3ea2ecedb0,'0.1E3',9(18)>>
>> paul = Account.create(:balance => 200, :number => "54321")
=> #<Account id: 2, number: "54321", balance: #<BigDecimal:7f3ea2e92248,'0.2E3',9(18)>>
>> case ARGV[0] || "1"
>> when "1"
>> Account.transaction do
?> paul.deposit(10)
>> peter.withdraw(10)
>> end
>> when "2"
>> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> when "3"
>> begin
?> Account.transaction do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "4"
>> begin
?> Account.transaction(peter, paul) do
?> paul.deposit(350)
>> peter.withdraw(350)
>> end
>> rescue
>> puts "Transfer aborted"
>> end
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> when "5"
>> Account.transfer(peter, paul, 350) rescue puts "Transfer aborted"
>> puts "Paul has #{paul.balance}"
>> puts "Peter has #{peter.balance}"
>> end
Transfer aborted
Paul has 200.0
Peter has 100.0
=> nil
>> >> => nil
irb e1/ar/optimistic.rb
>> $: << File.dirname(__FILE__)
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/x86_64-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/x86_64-linux", ".", "../../code/e1/ar"]
>> require "connect"
=> true
>> require "rubygems"
=> []
>> require "activerecord"
=> []
>> ActiveRecord::Schema.define do
?> create_table :counters, :force => true do |t|
?> t.integer :count
>> t.integer :lock_version, :default => 0
>> end
>> end
-- create_table(:counters, {:force=>true})
-> 0.0460s
=> nil
?> class Counter < ActiveRecord::Base
>> end
=> nil
>> Counter.delete_all
=> 0
>> Counter.create(:count => 0)
=> #<Counter id: 1, count: 0, lock_version: 0>
>> count1 = Counter.find(:first)
=> #<Counter id: 1, count: 0, lock_version: 0>
>> count2 = Counter.find(:first)
=> #<Counter id: 1, count: 0, lock_version: 0>
>> count1.count += 3
=> 3
>> count1.save
=> true
>> count2.count += 4
=> 4
>> count2.save
ActiveRecord::StaleObjectError: Attempted to update a stale object
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/locking/optimistic.rb:89:in `update_without_dirty'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/dirty.rb:146:in `update_without_timestamps'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/timestamp.rb:38:in `update_without_callbacks'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/callbacks.rb:282:in `update'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/base.rb:2869:in `create_or_update_without_callbacks'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/callbacks.rb:250:in `create_or_update'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/base.rb:2539:in `save_without_validation'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/validations.rb:1009:in `save_without_dirty'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/dirty.rb:79:in `save_without_transactions'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:229:in `send'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:182:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:196:in `save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.1/lib/active_record/transactions.rb:196:in `save'
from ../../code/e1/ar/optimistic.rb:31>> #END:optimistic
?> >> => nil
20 Action Controller: Routing and URLs
rails restful
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
ln -s ~/git/rails vendor/rails
ruby script/generate scaffold article title:string summary:text content:text
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/articles
exists app/views/layouts/
exists test/functional/
exists test/unit/
create test/unit/helpers/
exists public/stylesheets/
create app/views/articles/index.html.erb
create app/views/articles/show.html.erb
create app/views/articles/new.html.erb
create app/views/articles/edit.html.erb
create app/views/layouts/articles.html.erb
create public/stylesheets/scaffold.css
create app/controllers/articles_controller.rb
create test/functional/articles_controller_test.rb
create app/helpers/articles_helper.rb
create test/unit/helpers/articles_helper_test.rb
route map.resources :articles
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/article.rb
create test/unit/article_test.rb
create test/fixtures/articles.yml
create db/migrate
create db/migrate/20090309203309_create_articles.rb
rake db:migrate
mv 20090309203309_create_articles.rb 20080601000001_create_articles.rb
(in /home/rubys/svn/RAILS3/Book/util/restful)
== CreateArticles: migrating =================================================
-- create_table(:articles)
-> 0.0088s
== CreateArticles: migrated (0.0089s) ========================================
rake routes
(in /home/rubys/svn/RAILS3/Book/util/restful)
articles GET /articles(.:format) {:action=>"index", :controller=>"articles"}
POST /articles(.:format) {:action=>"create", :controller=>"articles"}
new_article GET /articles/new(.:format) {:action=>"new", :controller=>"articles"}
edit_article GET /articles/:id/edit(.:format) {:action=>"edit", :controller=>"articles"}
article GET /articles/:id(.:format) {:action=>"show", :controller=>"articles"}
PUT /articles/:id(.:format) {:action=>"update", :controller=>"articles"}
DELETE /articles/:id(.:format) {:action=>"destroy", :controller=>"articles"}
/:controller/:action/:id
/:controller/:action/:id(.:format)
edit config/routes.rb
ActionController::Routing::Routes.draw do |map|
map.resources :articles
# ...
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
edit app/controllers/articles_controller.rb
class ArticlesController < ApplicationController
# GET /articles
# GET /articles.xml
def index
@articles = Article.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @articles }
end
end
# GET /articles/1
# GET /articles/1.xml
def show
@article = Article.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @article }
end
end
# GET /articles/new
# GET /articles/new.xml
def new
@article = Article.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @article }
end
end
# GET /articles/1/edit
def edit
@article = Article.find(params[:id])
end
# POST /articles
# POST /articles.xml
def create
@article = Article.new(params[:article])
respond_to do |format|
if @article.save
flash[:notice] = 'Article was successfully created.'
format.html { redirect_to(@article) }
format.xml { render :xml => @article, :status => :created,
:location => @article }
else
format.html { render :action => "new" }
format.xml { render :xml => @article.errors,
:status => :unprocessable_entity }
end
end
end
# PUT /articles/1
# PUT /articles/1.xml
def update
@article = Article.find(params[:id])
respond_to do |format|
if @article.update_attributes(params[:article])
flash[:notice] = 'Article was successfully updated.'
format.html { redirect_to(@article) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @article.errors,
:status => :unprocessable_entity }
end
end
end
# DELETE /articles/1
# DELETE /articles/1.xml
def destroy
@article = Article.find(params[:id])
@article.destroy
respond_to do |format|
format.html { redirect_to(articles_url) }
format.xml { head :ok }
end
end
end
edit app/views/articles/index.html.erb
<h1>Listing articles</h1>
<table>
<tr>
<th>Title</th>
<th>Summary</th>
<th>Content</th>
</tr>
<% @articles.each do |article| %>
<tr>
<td><%=h article.title %></td>
<td><%=h article.summary %></td>
<td><%=h article.content %></td>
<td><%= link_to 'Show', article %></td>
<td><%= link_to 'Edit', edit_article_path(article) %></td>
<td><%= link_to 'Destroy', article, :confirm => 'Are you sure?',
:method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New article', new_article_path %>
edit config/routes.rb
ActionController::Routing::Routes.draw do |map|
map.resources :articles, :collection => { :recent => :get }
# ...
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# map.resources :products
# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
# Sample resource route with sub-resources:
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
# Sample resource route with more complex sub-resources
# map.resources :products do |products|
# products.resources :comments
# products.resources :sales, :collection => { :recent => :get }
# end
# Sample resource route within a namespace:
# map.namespace :admin do |admin|
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
# admin.resources :products
# end
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
# map.root :controller => "welcome"
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every controller accessible via GET requests. You should
# consider removing the them or commenting them out if you're using named routes and resources.
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
rake routes
(in /home/rubys/svn/RAILS3/Book/util/restful)
recent_articles GET /articles/recent(.:format) {:action=>"recent", :controller=>"articles"}
articles GET /articles(.:format) {:action=>"index", :controller=>"articles"}
POST /articles(.:format) {:action=>"create", :controller=>"articles"}
new_article GET /articles/new(.:format) {:action=>"new", :controller=>"articles"}
edit_article GET /articles/:id/edit(.:format) {:action=>"edit", :controller=>"articles"}
article GET /articles/:id(.:format) {:action=>"show", :controller=>"articles"}
PUT /articles/:id(.:format) {:action=>"update", :controller=>"articles"}
DELETE /articles/:id(.:format) {:action=>"destroy", :controller=>"articles"}
/:controller/:action/:id
/:controller/:action/:id(.:format)
edit config/routes.rb
ActionController::Routing::Routes.draw do |map|
map.resources :articles, :member => { :embargo => :put, :release => :put }
# ...
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# map.resources :products
# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
# Sample resource route with sub-resources:
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
# Sample resource route with more complex sub-resources
# map.resources :products do |products|
# products.resources :comments
# products.resources :sales, :collection => { :recent => :get }
# end
# Sample resource route within a namespace:
# map.namespace :admin do |admin|
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
# admin.resources :products
# end
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
# map.root :controller => "welcome"
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every controller accessible via GET requests. You should
# consider removing the them or commenting them out if you're using named routes and resources.
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
rake routes
(in /home/rubys/svn/RAILS3/Book/util/restful)
articles GET /articles(.:format) {:action=>"index", :controller=>"articles"}
POST /articles(.:format) {:action=>"create", :controller=>"articles"}
new_article GET /articles/new(.:format) {:action=>"new", :controller=>"articles"}
embargo_article PUT /articles/:id/embargo(.:format) {:action=>"embargo", :controller=>"articles"}
release_article PUT /articles/:id/release(.:format) {:action=>"release", :controller=>"articles"}
edit_article GET /articles/:id/edit(.:format) {:action=>"edit", :controller=>"articles"}
article GET /articles/:id(.:format) {:action=>"show", :controller=>"articles"}
PUT /articles/:id(.:format) {:action=>"update", :controller=>"articles"}
DELETE /articles/:id(.:format) {:action=>"destroy", :controller=>"articles"}
/:controller/:action/:id
/:controller/:action/:id(.:format)
edit config/routes.rb
ActionController::Routing::Routes.draw do |map|
map.resources :articles, :new => { :shortform => :post }
# ...
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# map.resources :products
# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
# Sample resource route with sub-resources:
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
# Sample resource route with more complex sub-resources
# map.resources :products do |products|
# products.resources :comments
# products.resources :sales, :collection => { :recent => :get }
# end
# Sample resource route within a namespace:
# map.namespace :admin do |admin|
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
# admin.resources :products
# end
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
# map.root :controller => "welcome"
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every controller accessible via GET requests. You should
# consider removing the them or commenting them out if you're using named routes and resources.
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
rake routes
(in /home/rubys/svn/RAILS3/Book/util/restful)
articles GET /articles(.:format) {:action=>"index", :controller=>"articles"}
POST /articles(.:format) {:action=>"create", :controller=>"articles"}
shortform_new_article POST /articles/new/shortform(.:format) {:action=>"shortform", :controller=>"articles"}
new_article GET /articles/new(.:format) {:action=>"new", :controller=>"articles"}
edit_article GET /articles/:id/edit(.:format) {:action=>"edit", :controller=>"articles"}
article GET /articles/:id(.:format) {:action=>"show", :controller=>"articles"}
PUT /articles/:id(.:format) {:action=>"update", :controller=>"articles"}
DELETE /articles/:id(.:format) {:action=>"destroy", :controller=>"articles"}
/:controller/:action/:id
/:controller/:action/:id(.:format)
edit config/routes.rb
ActionController::Routing::Routes.draw do |map|
map.resources :articles do |article|
article.resources :comments
end
# ...
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
rake routes
(in /home/rubys/svn/RAILS3/Book/util/restful)
articles GET /articles(.:format) {:action=>"index", :controller=>"articles"}
POST /articles(.:format) {:action=>"create", :controller=>"articles"}
new_article GET /articles/new(.:format) {:action=>"new", :controller=>"articles"}
edit_article GET /articles/:id/edit(.:format) {:action=>"edit", :controller=>"articles"}
article GET /articles/:id(.:format) {:action=>"show", :controller=>"articles"}
PUT /articles/:id(.:format) {:action=>"update", :controller=>"articles"}
DELETE /articles/:id(.:format) {:action=>"destroy", :controller=>"articles"}
article_comments GET /articles/:article_id/comments(.:format) {:action=>"index", :controller=>"comments"}
POST /articles/:article_id/comments(.:format) {:action=>"create", :controller=>"comments"}
new_article_comment GET /articles/:article_id/comments/new(.:format) {:action=>"new", :controller=>"comments"}
edit_article_comment GET /articles/:article_id/comments/:id/edit(.:format) {:action=>"edit", :controller=>"comments"}
article_comment GET /articles/:article_id/comments/:id(.:format) {:action=>"show", :controller=>"comments"}
PUT /articles/:article_id/comments/:id(.:format) {:action=>"update", :controller=>"comments"}
DELETE /articles/:article_id/comments/:id(.:format) {:action=>"destroy", :controller=>"comments"}
/:controller/:action/:id
/:controller/:action/:id(.:format)
ruby script/generate model comment comment:text article_id:integer
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/comment.rb
create test/unit/comment_test.rb
create test/fixtures/comments.yml
exists db/migrate
create db/migrate/20090309203317_create_comments.rb
ruby script/generate controller comments new edit update destroy
exists app/controllers/
exists app/helpers/
create app/views/comments
exists test/functional/
exists test/unit/helpers/
create app/controllers/comments_controller.rb
create test/functional/comments_controller_test.rb
create app/helpers/comments_helper.rb
create test/unit/helpers/comments_helper_test.rb
create app/views/comments/new.html.erb
create app/views/comments/edit.html.erb
create app/views/comments/update.html.erb
create app/views/comments/destroy.html.erb
rm app/views/comments/destroy.html.erb
rm app/views/comments/update.html.erb
edit app/models/article.rb
class Article < ActiveRecord::Base
has_many :comments
end
edit app/models/comment.rb
class Comment < ActiveRecord::Base
belongs_to :article
end
rake db:migrate
mv 20090309203317_create_comments.rb 20080601000002_create_comments.rb
(in /home/rubys/svn/RAILS3/Book/util/restful)
== CreateComments: migrating =================================================
-- create_table(:comments)
-> 0.0257s
== CreateComments: migrated (0.0258s) ========================================
edit app/views/articles/show.html.erb
<p>
<b>Title:</b>
<%=h @article.title %>
</p>
<p>
<b>Summary:</b>
<%=h @article.summary %>
</p>
<p>
<b>Content:</b>
<%=h @article.content %>
</p>
<% unless @article.comments.empty? %>
<%= render :partial => "/comments/comment",
:collection => @article.comments %>
<% end %>
<%= link_to "Add comment", new_article_comment_url(@article) %> |
<%= link_to 'Edit', edit_article_path(@article) %> |
<%= link_to 'Back', articles_path %>
edit app/views/comments/_comment.html.erb
<div class="comment">
<p>
<strong>Comment last updated: <%= comment.updated_at %></strong>
<%= link_to "Edit", edit_article_comment_url(:id => comment,
:article_id => comment.article) %>
<%= link_to "Delete", article_comment_url(:id => comment,
:article_id => comment.article),
:method => :delete %>
</p>
<blockquote>
<%=h comment.comment %>
</blockquote>
</div>
edit app/views/comments/_form.html.erb
<%= form.text_area :comment, :rows => 3 %>
edit app/views/comments/edit.html.erb
<h1>Editing comment</h1>
<%= error_messages_for :comment %>
<% form_for([@article,@comment]) do |f| %>
<p>
<b>Comment</b><br />
<%= f.text_area :comment %>
</p>
<p>
<b>Article</b><br />
<%= f.text_field :article_id %>
</p>
<p>
<%= f.submit "Update" %>
</p>
<% end %>
<%= link_to 'Back', article_path %>
edit app/views/comments/new.html.erb
<% form_for [@article, @comment] do |form| %>
<fieldset>
<legend>Add a Comment</legend>
<%= render :partial => 'form', :object => form %>
<p>
<%= submit_tag "Create" %>
</p>
</fieldset>
<% end %>
edit app/controllers/comments_controller.rb
class CommentsController < ApplicationController
before_filter :find_article
def new
@comment = Comment.new
end
def edit
@comment = @article.comments.find(params[:id])
end
def create
@comment = Comment.new(params[:comment])
if (@article.comments << @comment)
redirect_to article_url(@article)
else
render :action => :new
end
end
def update
@comment = @article.comments.find(params[:id])
if @comment.update_attributes(params[:comment])
redirect_to article_url(@article)
else
render :action => :edit
end
end
def destroy
comment = @article.comments.find(params[:id])
@article.comments.delete(comment)
redirect_to article_url(@article)
end
private
def find_article
@article_id = params[:article_id]
return(redirect_to(articles_url)) unless @article_id
@article = Article.find(@article_id)
end
end
rails routing
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
ln -s ~/git/rails vendor/rails
ruby script/generate controller store index add_to_cart
exists app/controllers/
exists app/helpers/
create app/views/store
exists test/functional/
create test/unit/helpers/
create app/controllers/store_controller.rb
create test/functional/store_controller_test.rb
create app/helpers/store_helper.rb
create test/unit/helpers/store_helper_test.rb
create app/views/store/index.html.erb
create app/views/store/add_to_cart.html.erb
cp -v ../data/routing/* config
`../data/routing/routes_for_blog.rb' -> `config/routes_for_blog.rb'
`../data/routing/routes_for_depot.rb' -> `config/routes_for_depot.rb'
`../data/routing/routes_with_conditions.rb' -> `config/routes_with_conditions.rb'
`../data/routing/routes_with_names.rb' -> `config/routes_with_names.rb'
`../data/routing/routing_conditions_test.rb' -> `config/routing_conditions_test.rb'
`../data/routing/routing_test.rb' -> `config/routing_test.rb'
mv -v config/*_test.rb test/unit
`config/routing_conditions_test.rb' -> `test/unit/routing_conditions_test.rb'
`config/routing_test.rb' -> `test/unit/routing_test.rb'
rake test
rake aborted!
no such file to load -- /home/rubys/svn/RAILS3/Book/util/routing/db/schema.rb
(See full trace by running task with --trace)
(in /home/rubys/svn/RAILS3/Book/util/routing)
20.2 Routing Requests
irb e1/routing/config/routes_for_depot.rb
>> require 'activesupport'
=> true
>> require 'action_controller'
=> ["HTML", "ActionController", "Mime"]
>> require 'action_controller/integration'
=> []
>> load "config/routes.rb"
=> []
>> ActionController::Routing.use_controllers! ["store", "admin", "coupon"]
=> ["store", "admin", "coupon"]
>> rs = ActionController::Routing::Routes
=> #<ActionController::Routing::RouteSet:0x7f0241f6eec0 @named_routes=#<ActionController::Routing::RouteSet::NamedRouteCollection:0x7f0241f2bc60 @module=#<Module:0x7f0241f2b0a8>, @helpers=[:hash_for_users_url, :users_url, :hash_for_users_path, :users_path, :hash_for_new_user_url, :new_user_url, :hash_for_new_user_path, :new_user_path, :hash_for_edit_user_url, :edit_user_url, :hash_for_edit_user_path, :edit_user_path, :hash_for_user_url, :user_url, :hash_for_user_path, :user_path, :hash_for_line_items_url, :line_items_url, :hash_for_line_items_path, :line_items_path, :hash_for_new_line_item_url, :new_line_item_url, :hash_for_new_line_item_path, :new_line_item_path, :hash_for_edit_line_item_url, :edit_line_item_url, :hash_for_edit_line_item_path, :edit_line_item_path, :hash_for_line_item_url, :line_item_url, :hash_for_line_item_path, :line_item_path, :hash_for_orders_url, :orders_url, :hash_for_orders_path, :orders_path, :hash_for_new_order_url, :new_order_url, :hash_for_new_order_path, :new_order_path, :hash_for_edit_order_url, :edit_order_url, :hash_for_edit_order_path, :edit_order_path, :hash_for_order_url, :order_url, :hash_for_order_path, :order_path, :hash_for_order_line_items_url, :order_line_items_url, :hash_for_order_line_items_path, :order_line_items_path, :hash_for_new_order_line_item_url, :new_order_line_item_url, :hash_for_new_order_line_item_path, :new_order_line_item_path, :hash_for_edit_order_line_item_url, :edit_order_line_item_url, :hash_for_edit_order_line_item_path, :edit_order_line_item_path, :hash_for_order_line_item_url, :order_line_item_url, :hash_for_order_line_item_path, :order_line_item_path, :hash_for_products_url, :products_url, :hash_for_products_path, :products_path, :hash_for_new_product_url, :new_product_url, :hash_for_new_product_path, :new_product_path, :hash_for_edit_product_url, :edit_product_url, :hash_for_edit_product_path, :edit_product_path, :hash_for_product_url, :product_url, :hash_for_product_path, :product_path], @routes={:order=>#<ActionController::Routing::Route:0x7f023ff458d8 @action_requirement="show", @defaults={:action=>"show", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"show"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"orders"}, @to_s="GET /orders/:id(.:format)? {:controller=>\"orders\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff46828 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff466e8 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff46580 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff46440 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff46350 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :new_order=>#<ActionController::Routing::Route:0x7f023ff637c0 @action_requirement="new", @defaults={:action=>"new", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"new"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"orders"}, @to_s="GET /orders/new(.:format)? {:controller=>\"orders\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff644b8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff64378 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff64210 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff640d0 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff63fe0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :new_line_item=>#<ActionController::Routing::Route:0x7f023ffaf030 @action_requirement="new", @defaults={:action=>"new", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"new"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"line_items"}, @to_s="GET /line_items/new(.:format)? {:controller=>\"line_items\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffafd28 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffafbe8 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffafa80 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffaf940 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffaf850 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :new_product=>#<ActionController::Routing::Route:0x7f023febbd90 @action_requirement="new", @defaults={:action=>"new", :controller=>"products"}, @requirements={:controller=>"products", :action=>"new"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"products"}, @to_s="GET /products/new(.:format)? {:controller=>\"products\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023febca88 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023febc948 @value="products", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023febc7e0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023febc6a0 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023febc5b0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :products=>#<ActionController::Routing::Route:0x7f023fed1e10 @action_requirement="index", @defaults={:action=>"index", :controller=>"products"}, @requirements={:controller=>"products", :action=>"index"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"products"}, @to_s="GET /products(.:format)? {:controller=>\"products\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fed27c0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fed2680 @value="products", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fed2590 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :new_user=>#<ActionController::Routing::Route:0x7f023fffa8a0 @action_requirement="new", @defaults={:action=>"new", :controller=>"users"}, @requirements={:controller=>"users", :action=>"new"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"users"}, @to_s="GET /users/new(.:format)? {:controller=>\"users\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fffb598 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fffb458 @value="users", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fffb2f0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fffb1b0 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fffb0c0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :new_order_line_item=>#<ActionController::Routing::Route:0x7f023ff12398 @action_requirement="new", @defaults={:action=>"new", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"new"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"line_items"}, @to_s="GET /orders/:order_id/line_items/new(.:format)? {:controller=>\"line_items\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff13720 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff135e0 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff13478 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff13338 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff131d0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff13090 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff12f28 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff12de8 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff12cf8 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :edit_order=>#<ActionController::Routing::Route:0x7f023ff50fa8 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"edit"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"orders"}, @to_s="GET /orders/:id/edit(.:format)? {:controller=>\"orders\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff52240 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff52100 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff51f98 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff51e58 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff51cf0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff51bb0 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff51ac0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :edit_line_item=>#<ActionController::Routing::Route:0x7f023ff9c818 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"edit"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"line_items"}, @to_s="GET /line_items/:id/edit(.:format)? {:controller=>\"line_items\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff9dab0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff9d970 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff9d808 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff9d6c8 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff9d560 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff9d420 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff9d330 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :product=>#<ActionController::Routing::Route:0x7f023fe9dea8 @action_requirement="show", @defaults={:action=>"show", :controller=>"products"}, @requirements={:controller=>"products", :action=>"show"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"products"}, @to_s="GET /products/:id(.:format)? {:controller=>\"products\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fe9edf8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fe9ecb8 @value="products", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fe9eb50 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fe9ea10 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fe9e920 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :edit_product=>#<ActionController::Routing::Route:0x7f023fea9578 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"products"}, @requirements={:controller=>"products", :action=>"edit"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"products"}, @to_s="GET /products/:id/edit(.:format)? {:controller=>\"products\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023feaa810 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023feaa6d0 @value="products", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feaa568 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023feaa428 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feaa2c0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023feaa180 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023feaa090 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :edit_user=>#<ActionController::Routing::Route:0x7f023ffe8088 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"users"}, @requirements={:controller=>"users", :action=>"edit"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"users"}, @to_s="GET /users/:id/edit(.:format)? {:controller=>\"users\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffe9320 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffe91e0 @value="users", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffe9078 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ffe8f38 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffe8dd0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffe8c90 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffe8ba0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :users=>#<ActionController::Routing::Route:0x7f0241eef580 @action_requirement="index", @defaults={:action=>"index", :controller=>"users"}, @requirements={:controller=>"users", :action=>"index"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"users"}, @to_s="GET /users(.:format)? {:controller=>\"users\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f0241efcde8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f0241efbb78 @value="users", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f0241efa430 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :edit_order_line_item=>#<ActionController::Routing::Route:0x7f023fefc368 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"edit"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"line_items"}, @to_s="GET /orders/:order_id/line_items/:id/edit(.:format)? {:controller=>\"line_items\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fefdd30 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fefdbf0 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fefda88 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fefd948 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fefd7e0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fefd6a0 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fefd538 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fefd3f8 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fefd290 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fefd150 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fefd060 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :order_line_items=>#<ActionController::Routing::Route:0x7f023ff2d990 @action_requirement="index", @defaults={:action=>"index", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"index"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"line_items"}, @to_s="GET /orders/:order_id/line_items(.:format)? {:controller=>\"line_items\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff2e9d0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff2e890 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff2e728 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff2e5e8 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff2e480 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff2e340 @value="line_items", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff2e250 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :line_item=>#<ActionController::Routing::Route:0x7f023ff91148 @action_requirement="show", @defaults={:action=>"show", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"show"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"line_items"}, @to_s="GET /line_items/:id(.:format)? {:controller=>\"line_items\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff92098 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff91f58 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff91df0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff91cb0 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff91bc0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :line_items=>#<ActionController::Routing::Route:0x7f023ffc50b0 @action_requirement="index", @defaults={:action=>"index", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"index"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"line_items"}, @to_s="GET /line_items(.:format)? {:controller=>\"line_items\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffc5a60 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffc5920 @value="line_items", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffc5830 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :order_line_item=>#<ActionController::Routing::Route:0x7f023feeed30 @action_requirement="show", @defaults={:action=>"show", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"show"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"line_items"}, @to_s="GET /orders/:order_id/line_items/:id(.:format)? {:controller=>\"line_items\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fef03b0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fef0270 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fef0108 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023feeffc8 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feefe60 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023feefd20 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feefbb8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023feefa78 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023feef988 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :orders=>#<ActionController::Routing::Route:0x7f023ff79840 @action_requirement="index", @defaults={:action=>"index", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"index"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"orders"}, @to_s="GET /orders(.:format)? {:controller=>\"orders\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff7a1f0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff7a0b0 @value="orders", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff79fc0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, :user=>#<ActionController::Routing::Route:0x7f023ffdc9b8 @action_requirement="show", @defaults={:action=>"show", :controller=>"users"}, @requirements={:controller=>"users", :action=>"show"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"users"}, @to_s="GET /users/:id(.:format)? {:controller=>\"users\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffdd908 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffdd7c8 @value="users", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffdd660 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ffdd520 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffdd430 @key=:format, @is_optional=true>], @conditions={:method=>:get}>}>, @builder=#<ActionController::Routing::RouteBuilder:0x7f0241efe6c0 @optional_separators=["/"], @interval_regexp=/(.*?)((?-mix:[\/\.\?])|$)/, @separators=["/", ".", "?"], @nonseparator_regexp=/\A([^\/\.\?]+)/, @separator_regexp=/[\/\.\?]/>, @routes=[#<ActionController::Routing::Route:0x7f0241eef580 @action_requirement="index", @defaults={:action=>"index", :controller=>"users"}, @requirements={:controller=>"users", :action=>"index"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"users"}, @to_s="GET /users(.:format)? {:controller=>\"users\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f0241efcde8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f0241efbb78 @value="users", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f0241efa430 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ffff080 @action_requirement="create", @defaults={:action=>"create", :controller=>"users"}, @requirements={:controller=>"users", :action=>"create"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"create", :controller=>"users"}, @to_s="POST /users(.:format)? {:controller=>\"users\", :action=>\"create\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffffa30 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffff8f0 @value="users", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffff800 @key=:format, @is_optional=true>], @conditions={:method=>:post}>, #<ActionController::Routing::Route:0x7f023fffa8a0 @action_requirement="new", @defaults={:action=>"new", :controller=>"users"}, @requirements={:controller=>"users", :action=>"new"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"users"}, @to_s="GET /users/new(.:format)? {:controller=>\"users\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fffb598 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fffb458 @value="users", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fffb2f0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fffb1b0 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fffb0c0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ffe8088 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"users"}, @requirements={:controller=>"users", :action=>"edit"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"users"}, @to_s="GET /users/:id/edit(.:format)? {:controller=>\"users\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffe9320 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffe91e0 @value="users", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffe9078 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ffe8f38 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffe8dd0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffe8c90 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffe8ba0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ffdc9b8 @action_requirement="show", @defaults={:action=>"show", :controller=>"users"}, @requirements={:controller=>"users", :action=>"show"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"users"}, @to_s="GET /users/:id(.:format)? {:controller=>\"users\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffdd908 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffdd7c8 @value="users", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffdd660 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ffdd520 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffdd430 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ffd14a0 @action_requirement="update", @defaults={:action=>"update", :controller=>"users"}, @requirements={:controller=>"users", :action=>"update"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"update", :controller=>"users"}, @to_s="PUT /users/:id(.:format)? {:controller=>\"users\", :action=>\"update\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffd23f0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffd22b0 @value="users", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffd2148 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ffd2008 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffd1f18 @key=:format, @is_optional=true>], @conditions={:method=>:put}>, #<ActionController::Routing::Route:0x7f023ffcb3e8 @action_requirement="destroy", @defaults={:action=>"destroy", :controller=>"users"}, @requirements={:controller=>"users", :action=>"destroy"}, @controller_requirement="users", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"destroy", :controller=>"users"}, @to_s="DELETE /users/:id(.:format)? {:controller=>\"users\", :action=>\"destroy\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffcc338 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffcc1f8 @value="users", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffcc090 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ffcbf50 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffcbe60 @key=:format, @is_optional=true>], @conditions={:method=>:delete}>, #<ActionController::Routing::Route:0x7f023ffc50b0 @action_requirement="index", @defaults={:action=>"index", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"index"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"line_items"}, @to_s="GET /line_items(.:format)? {:controller=>\"line_items\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffc5a60 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffc5920 @value="line_items", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffc5830 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ffb3810 @action_requirement="create", @defaults={:action=>"create", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"create"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"create", :controller=>"line_items"}, @to_s="POST /line_items(.:format)? {:controller=>\"line_items\", :action=>\"create\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffb41c0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffb4080 @value="line_items", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffb3f90 @key=:format, @is_optional=true>], @conditions={:method=>:post}>, #<ActionController::Routing::Route:0x7f023ffaf030 @action_requirement="new", @defaults={:action=>"new", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"new"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"line_items"}, @to_s="GET /line_items/new(.:format)? {:controller=>\"line_items\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ffafd28 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffafbe8 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ffafa80 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ffaf940 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ffaf850 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ff9c818 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"edit"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"line_items"}, @to_s="GET /line_items/:id/edit(.:format)? {:controller=>\"line_items\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff9dab0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff9d970 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff9d808 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff9d6c8 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff9d560 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff9d420 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff9d330 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ff91148 @action_requirement="show", @defaults={:action=>"show", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"show"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"line_items"}, @to_s="GET /line_items/:id(.:format)? {:controller=>\"line_items\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff92098 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff91f58 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff91df0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff91cb0 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff91bc0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ff85c30 @action_requirement="update", @defaults={:action=>"update", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"update"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"update", :controller=>"line_items"}, @to_s="PUT /line_items/:id(.:format)? {:controller=>\"line_items\", :action=>\"update\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff86b80 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff86a40 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff868d8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff86798 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff866a8 @key=:format, @is_optional=true>], @conditions={:method=>:put}>, #<ActionController::Routing::Route:0x7f023ff7fb78 @action_requirement="destroy", @defaults={:action=>"destroy", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"destroy"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"destroy", :controller=>"line_items"}, @to_s="DELETE /line_items/:id(.:format)? {:controller=>\"line_items\", :action=>\"destroy\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff80ac8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff80988 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff80820 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff806e0 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff805f0 @key=:format, @is_optional=true>], @conditions={:method=>:delete}>, #<ActionController::Routing::Route:0x7f023ff79840 @action_requirement="index", @defaults={:action=>"index", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"index"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"orders"}, @to_s="GET /orders(.:format)? {:controller=>\"orders\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff7a1f0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff7a0b0 @value="orders", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff79fc0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ff67fa0 @action_requirement="create", @defaults={:action=>"create", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"create"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"create", :controller=>"orders"}, @to_s="POST /orders(.:format)? {:controller=>\"orders\", :action=>\"create\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff68950 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff68810 @value="orders", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff68720 @key=:format, @is_optional=true>], @conditions={:method=>:post}>, #<ActionController::Routing::Route:0x7f023ff637c0 @action_requirement="new", @defaults={:action=>"new", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"new"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"orders"}, @to_s="GET /orders/new(.:format)? {:controller=>\"orders\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff644b8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff64378 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff64210 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff640d0 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff63fe0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ff50fa8 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"edit"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"orders"}, @to_s="GET /orders/:id/edit(.:format)? {:controller=>\"orders\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff52240 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff52100 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff51f98 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff51e58 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff51cf0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff51bb0 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff51ac0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ff458d8 @action_requirement="show", @defaults={:action=>"show", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"show"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"orders"}, @to_s="GET /orders/:id(.:format)? {:controller=>\"orders\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff46828 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff466e8 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff46580 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff46440 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff46350 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ff3a3c0 @action_requirement="update", @defaults={:action=>"update", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"update"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"update", :controller=>"orders"}, @to_s="PUT /orders/:id(.:format)? {:controller=>\"orders\", :action=>\"update\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff3b310 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff3b1d0 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff3b068 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff3af28 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff3ae38 @key=:format, @is_optional=true>], @conditions={:method=>:put}>, #<ActionController::Routing::Route:0x7f023ff34308 @action_requirement="destroy", @defaults={:action=>"destroy", :controller=>"orders"}, @requirements={:controller=>"orders", :action=>"destroy"}, @controller_requirement="orders", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"destroy", :controller=>"orders"}, @to_s="DELETE /orders/:id(.:format)? {:controller=>\"orders\", :action=>\"destroy\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff35258 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff35118 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff34fb0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff34e70 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff34d80 @key=:format, @is_optional=true>], @conditions={:method=>:delete}>, #<ActionController::Routing::Route:0x7f023ff2d990 @action_requirement="index", @defaults={:action=>"index", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"index"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"line_items"}, @to_s="GET /orders/:order_id/line_items(.:format)? {:controller=>\"line_items\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff2e9d0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff2e890 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff2e728 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff2e5e8 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff2e480 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff2e340 @value="line_items", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff2e250 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023ff18928 @action_requirement="create", @defaults={:action=>"create", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"create"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :format, :controller, :action], @parameter_shell={:action=>"create", :controller=>"line_items"}, @to_s="POST /orders/:order_id/line_items(.:format)? {:controller=>\"line_items\", :action=>\"create\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff19968 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff19828 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff196c0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff19580 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff19418 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff192d8 @value="line_items", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff191e8 @key=:format, @is_optional=true>], @conditions={:method=>:post}>, #<ActionController::Routing::Route:0x7f023ff12398 @action_requirement="new", @defaults={:action=>"new", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"new"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"line_items"}, @to_s="GET /orders/:order_id/line_items/new(.:format)? {:controller=>\"line_items\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023ff13720 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff135e0 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff13478 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023ff13338 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff131d0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff13090 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023ff12f28 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023ff12de8 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023ff12cf8 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023fefc368 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"edit"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"line_items"}, @to_s="GET /orders/:order_id/line_items/:id/edit(.:format)? {:controller=>\"line_items\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fefdd30 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fefdbf0 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fefda88 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fefd948 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fefd7e0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fefd6a0 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fefd538 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fefd3f8 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fefd290 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fefd150 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fefd060 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023feeed30 @action_requirement="show", @defaults={:action=>"show", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"show"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"line_items"}, @to_s="GET /orders/:order_id/line_items/:id(.:format)? {:controller=>\"line_items\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fef03b0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fef0270 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fef0108 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023feeffc8 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feefe60 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023feefd20 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feefbb8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023feefa78 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023feef988 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023fee18b0 @action_requirement="update", @defaults={:action=>"update", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"update"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :id, :format, :controller, :action], @parameter_shell={:action=>"update", :controller=>"line_items"}, @to_s="PUT /orders/:order_id/line_items/:id(.:format)? {:controller=>\"line_items\", :action=>\"update\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fee2f30 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fee2df0 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fee2c88 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fee2b48 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fee29e0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fee28a0 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fee2738 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fee25f8 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fee2508 @key=:format, @is_optional=true>], @conditions={:method=>:put}>, #<ActionController::Routing::Route:0x7f023fed9980 @action_requirement="destroy", @defaults={:action=>"destroy", :controller=>"line_items"}, @requirements={:controller=>"line_items", :action=>"destroy"}, @controller_requirement="line_items", @matching_prepared=true, @significant_keys=[:order_id, :id, :format, :controller, :action], @parameter_shell={:action=>"destroy", :controller=>"line_items"}, @to_s="DELETE /orders/:order_id/line_items/:id(.:format)? {:controller=>\"line_items\", :action=>\"destroy\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fedb000 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fedaec0 @value="orders", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fedad58 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fedac18 @key=:order_id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fedaab0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023feda970 @value="line_items", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feda808 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023feda6c8 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023feda5d8 @key=:format, @is_optional=true>], @conditions={:method=>:delete}>, #<ActionController::Routing::Route:0x7f023fed1e10 @action_requirement="index", @defaults={:action=>"index", :controller=>"products"}, @requirements={:controller=>"products", :action=>"index"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"index", :controller=>"products"}, @to_s="GET /products(.:format)? {:controller=>\"products\", :action=>\"index\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fed27c0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fed2680 @value="products", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fed2590 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023fec0570 @action_requirement="create", @defaults={:action=>"create", :controller=>"products"}, @requirements={:controller=>"products", :action=>"create"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"create", :controller=>"products"}, @to_s="POST /products(.:format)? {:controller=>\"products\", :action=>\"create\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fec0f20 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fec0de0 @value="products", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fec0cf0 @key=:format, @is_optional=true>], @conditions={:method=>:post}>, #<ActionController::Routing::Route:0x7f023febbd90 @action_requirement="new", @defaults={:action=>"new", :controller=>"products"}, @requirements={:controller=>"products", :action=>"new"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:format, :controller, :action], @parameter_shell={:action=>"new", :controller=>"products"}, @to_s="GET /products/new(.:format)? {:controller=>\"products\", :action=>\"new\"}", @optimise=true, @segments=[#<ActionController::Routing::DividerSegment:0x7f023febca88 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023febc948 @value="products", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023febc7e0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023febc6a0 @value="new", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023febc5b0 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023fea9578 @action_requirement="edit", @defaults={:action=>"edit", :controller=>"products"}, @requirements={:controller=>"products", :action=>"edit"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"edit", :controller=>"products"}, @to_s="GET /products/:id/edit(.:format)? {:controller=>\"products\", :action=>\"edit\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023feaa810 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023feaa6d0 @value="products", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feaa568 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023feaa428 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023feaa2c0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023feaa180 @value="edit", @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023feaa090 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023fe9dea8 @action_requirement="show", @defaults={:action=>"show", :controller=>"products"}, @requirements={:controller=>"products", :action=>"show"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"show", :controller=>"products"}, @to_s="GET /products/:id(.:format)? {:controller=>\"products\", :action=>\"show\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fe9edf8 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fe9ecb8 @value="products", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fe9eb50 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fe9ea10 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fe9e920 @key=:format, @is_optional=true>], @conditions={:method=>:get}>, #<ActionController::Routing::Route:0x7f023fe92990 @action_requirement="update", @defaults={:action=>"update", :controller=>"products"}, @requirements={:controller=>"products", :action=>"update"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"update", :controller=>"products"}, @to_s="PUT /products/:id(.:format)? {:controller=>\"products\", :action=>\"update\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fe938e0 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fe937a0 @value="products", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fe93638 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fe934f8 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fe93408 @key=:format, @is_optional=true>], @conditions={:method=>:put}>, #<ActionController::Routing::Route:0x7f023fe8c8d8 @action_requirement="destroy", @defaults={:action=>"destroy", :controller=>"products"}, @requirements={:controller=>"products", :action=>"destroy"}, @controller_requirement="products", @matching_prepared=true, @significant_keys=[:id, :format, :controller, :action], @parameter_shell={:action=>"destroy", :controller=>"products"}, @to_s="DELETE /products/:id(.:format)? {:controller=>\"products\", :action=>\"destroy\"}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fe8d828 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::StaticSegment:0x7f023fe8d6e8 @value="products", @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fe8d580 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::DynamicSegment:0x7f023fe8d440 @regexp=/[^\/.?]+/, @key=:id, @is_optional=false>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fe8d350 @key=:format, @is_optional=true>], @conditions={:method=>:delete}>, #<ActionController::Routing::Route:0x7f023fe86e10 @action_requirement=nil, @defaults={:action=>"index"}, @requirements={}, @controller_requirement=nil, @matching_prepared=true, @significant_keys=[:controller, :action, :id], @parameter_shell={}, @to_s="ANY /:controller/:action/:id/ {}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fe87900 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::ControllerSegment:0x7f023fe877c0 @key=:controller, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fe87658 @value="/", @raw=true, @is_optional=true>, #<ActionController::Routing::DynamicSegment:0x7f023fe87518 @default="index", @key=:action, @is_optional=true>, #<ActionController::Routing::DividerSegment:0x7f023fe873b0 @value="/", @raw=true, @is_optional=true>, #<ActionController::Routing::DynamicSegment:0x7f023fe87270 @key=:id, @is_optional=true>, #<ActionController::Routing::DividerSegment:0x7f023fe87108 @value="/", @raw=true, @is_optional=true>], @conditions={}>, #<ActionController::Routing::Route:0x7f023fe80380 @action_requirement=nil, @defaults={:action=>"index"}, @requirements={}, @controller_requirement=nil, @matching_prepared=true, @significant_keys=[:controller, :action, :id, :format], @parameter_shell={}, @to_s="ANY /:controller/:action/:id(.:format)? {}", @optimise=false, @segments=[#<ActionController::Routing::DividerSegment:0x7f023fe80e20 @value="/", @raw=true, @is_optional=false>, #<ActionController::Routing::ControllerSegment:0x7f023fe80ce0 @key=:controller, @is_optional=false>, #<ActionController::Routing::DividerSegment:0x7f023fe80b78 @value="/", @raw=true, @is_optional=true>, #<ActionController::Routing::DynamicSegment:0x7f023fe80a38 @default="index", @key=:action, @is_optional=true>, #<ActionController::Routing::DividerSegment:0x7f023fe808d0 @value="/", @raw=true, @is_optional=true>, #<ActionController::Routing::DynamicSegment:0x7f023fe80790 @key=:id, @is_optional=true>, #<ActionController::Routing::OptionalFormatSegment:0x7f023fe806a0 @key=:format, @is_optional=true>], @conditions={}>], @configuration_files=[]>
>> app = ActionController::Integration::Session.new
ArgumentError: A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/session/cookie_store.rb:163:in `ensure_session_key'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/session/cookie_store.rb:74:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:72:in `new'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:72:in `build'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:116:in `build'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.1/lib/active_support/inflector.rb:359:in `inject'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:116:in `each'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:116:in `inject'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:116:in `build'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/dispatcher.rb:82:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/integration.rb:68:in `new'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/integration.rb:68:in `initialize'
from ../../code/e1/routing/config/routes_for_depot.rb:8:in `new'
from ../../code/e1/routing/config/routes_for_depot.rb:8
from :0
>> puts rs.routes
GET /users(.:format)? {:controller=>"users", :action=>"index"}
POST /users(.:format)? {:controller=>"users", :action=>"create"}
GET /users/new(.:format)? {:controller=>"users", :action=>"new"}
GET /users/:id/edit(.:format)? {:controller=>"users", :action=>"edit"}
GET /users/:id(.:format)? {:controller=>"users", :action=>"show"}
PUT /users/:id(.:format)? {:controller=>"users", :action=>"update"}
DELETE /users/:id(.:format)? {:controller=>"users", :action=>"destroy"}
GET /line_items(.:format)? {:controller=>"line_items", :action=>"index"}
POST /line_items(.:format)? {:controller=>"line_items", :action=>"create"}
GET /line_items/new(.:format)? {:controller=>"line_items", :action=>"new"}
GET /line_items/:id/edit(.:format)? {:controller=>"line_items", :action=>"edit"}
GET /line_items/:id(.:format)? {:controller=>"line_items", :action=>"show"}
PUT /line_items/:id(.:format)? {:controller=>"line_items", :action=>"update"}
DELETE /line_items/:id(.:format)? {:controller=>"line_items", :action=>"destroy"}
GET /orders(.:format)? {:controller=>"orders", :action=>"index"}
POST /orders(.:format)? {:controller=>"orders", :action=>"create"}
GET /orders/new(.:format)? {:controller=>"orders", :action=>"new"}
GET /orders/:id/edit(.:format)? {:controller=>"orders", :action=>"edit"}
GET /orders/:id(.:format)? {:controller=>"orders", :action=>"show"}
PUT /orders/:id(.:format)? {:controller=>"orders", :action=>"update"}
DELETE /orders/:id(.:format)? {:controller=>"orders", :action=>"destroy"}
GET /orders/:order_id/line_items(.:format)? {:controller=>"line_items", :action=>"index"}
POST /orders/:order_id/line_items(.:format)? {:controller=>"line_items", :action=>"create"}
GET /orders/:order_id/line_items/new(.:format)? {:controller=>"line_items", :action=>"new"}
GET /orders/:order_id/line_items/:id/edit(.:format)? {:controller=>"line_items", :action=>"edit"}
GET /orders/:order_id/line_items/:id(.:format)? {:controller=>"line_items", :action=>"show"}
PUT /orders/:order_id/line_items/:id(.:format)? {:controller=>"line_items", :action=>"update"}
DELETE /orders/:order_id/line_items/:id(.:format)? {:controller=>"line_items", :action=>"destroy"}
GET /products(.:format)? {:controller=>"products", :action=>"index"}
POST /products(.:format)? {:controller=>"products", :action=>"create"}
GET /products/new(.:format)? {:controller=>"products", :action=>"new"}
GET /products/:id/edit(.:format)? {:controller=>"products", :action=>"edit"}
GET /products/:id(.:format)? {:controller=>"products", :action=>"show"}
PUT /products/:id(.:format)? {:controller=>"products", :action=>"update"}
DELETE /products/:id(.:format)? {:controller=>"products", :action=>"destroy"}
ANY /:controller/:action/:id/ {}
ANY /:controller/:action/:id(.:format)? {}
=> nil
>> rs.recognize_path "/store"
ActionController::RoutingError: No route matches "/store" with {}
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path'
from ../../code/e1/routing/config/routes_for_depot.rb:11
from :0
>> rs.recognize_path "/store/add_to_cart/1"
ActionController::RoutingError: No route matches "/store/add_to_cart/1" with {}
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path'
from ../../code/e1/routing/config/routes_for_depot.rb:12
from :0
>> rs.recognize_path "/store/add_to_cart/1.xml"
ActionController::RoutingError: No route matches "/store/add_to_cart/1.xml" with {}
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path'
from ../../code/e1/routing/config/routes_for_depot.rb:13
from :0
>> rs.generate :controller => :store
=> "/store"
>> rs.generate :controller => :store, :id => 123
=> "/store/index/123"
>> rs.recognize_path "/coupon/show/1"
ActionController::RoutingError: No route matches "/coupon/show/1" with {}
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path'
from ../../code/e1/routing/config/routes_for_depot.rb:16
from :0
>> load "config/routes.rb"
=> []
>> rs.recognize_path "/coupon/show/1"
=> {:action=>"show", :controller=>"coupon", :id=>"1"}
>> app.url_for :controller => :store, :action => :display, :id => 123
NoMethodError: undefined method `url_for' for nil:NilClass
from ../../code/e1/routing/config/routes_for_depot.rb:19
from :0
irb e1/routing/config/routes_for_blog.rb
>> require 'activesupport'
=> true
>> require 'action_controller'
=> ["HTML", "ActionController", "Mime"]
>> require 'action_controller/integration'
=> []
>> ActionController::Routing.use_controllers! [ "article", "blog" ]
=> ["article", "blog"]
>> rs = ActionController::Routing::Routes
=> #<ActionController::Routing::RouteSet:0x7fe5de3b7920 @named_routes=#<ActionController::Routing::RouteSet::NamedRouteCollection:0x7fe5de36b480 @module=#<Module:0x7fe5de36b138>, @helpers=[], @routes={}>, @routes=[], @configuration_files=[]>
>> app = ActionController::Integration::Session.new
ArgumentError: A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/session/cookie_store.rb:163:in `ensure_session_key'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/session/cookie_store.rb:74:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:72:in `new'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:72:in `build'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:116:in `build'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.1/lib/active_support/inflector.rb:359:in `inject'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:116:in `each'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:116:in `inject'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/middleware_stack.rb:116:in `build'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/dispatcher.rb:82:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/integration.rb:68:in `new'
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.1/lib/action_controller/integration.rb:68:in `initialize'
from ../../code/e1/routing/config/routes_for_blog.rb:7:in `new'
from ../../code/e1/routing/config/routes_for_blog.rb:7
?> ActionController::Routing::Routes.draw do |map|
?> # Straight 'http://my.app/blog/' displays the index
?> map.connect "blog/",
?> :controller => "blog",
?> :action => "index"
?> # Return articles for a year, year/month, or year/month/day
?> map.connect "blog/:year/:month/:day",
?> :controller => "blog",
?> :action => "show_date",
?> :requirements => { :year => /(19|20)\d\d/,
?> :month => /[01]?\d/,
?> :day => /[0-3]?\d/},
?> :day => nil,
?> :month => nil
>> # Show an article identified by an id
?> map.connect "blog/show/:id",
?> :controller => "blog",
?> :action => "show",
?> :id => /\d+/
>> # Regular Rails routing for admin stuff
?> map.connect "blog/:controller/:action/:id"
>> # Catchall so we can gracefully handle badly formed requests
?> map.connect "*anything",
?> :controller => "blog",
?> :action => "unknown_request"
>> end
=> [ActionController::Base, ActionView::Base]
>> rs.recognize_path "/blog"
=> {:controller=>"blog", :action=>"index"}
>> rs.recognize_path "/blog/show/123"
=> {:controller=>"blog", :action=>"show", :id=>"123"}
>> rs.recognize_path "/blog/2004"
=> {:year=>"2004", :controller=>"blog", :action=>"show_date"}
>> rs.recognize_path "/blog/2004/12"
=> {:month=>"12", :year=>"2004", :controller=>"blog", :action=>"show_date"}
>> rs.recognize_path "/blog/2004/12/25"
=> {:month=>"12", :year=>"2004", :controller=>"blog", :action=>"show_date", :day=>"25"}
>> rs.recognize_path "/blog/article/edit/123"
=> {:action=>"edit", :controller=>"article", :id=>"123"}
>> rs.recognize_path "/blog/article/show_stats"
=> {:action=>"show_stats", :controller=>"article"}
>> rs.recognize_path "/blog/wibble"
=> {:anything=>["blog", "wibble"], :controller=>"blog", :action=>"unknown_request"}
>> rs.recognize_path "/junk"
=> {:anything=>["junk"], :controller=>"blog", :action=>"unknown_request"}
>> last_request = rs.recognize_path "/blog/2006/07/28"
=> {:month=>"07", :year=>"2006", :controller=>"blog", :action=>"show_date", :day=>"28"}
>> rs.generate({:day => 25}, last_request)
=> "/blog/2006/07/25"
>> rs.generate({:year => 2005}, last_request)
=> "/blog/2005"
>> rs.generate({:action => "show" , :id => 123}, last_request)
=> "/blog/show/123"
>> rs.generate({:year => 2006}, last_request)
=> "/blog/2006/07/28"
>> rs.generate({:year => 2006, :month => nil}, last_request)
=> "/blog/2006"
>> app.url_for :controller => 'blog', :action => 'show_date', :year => 2002
NoMethodError: undefined method `url_for' for nil:NilClass
from ../../code/e1/routing/config/routes_for_blog.rb:62
>> app.url_for :controller => 'blog', :action => 'show_date', :overwrite_params => {:year => "2002" }
NoMethodError: undefined method `url_for' for nil:NilClass
from ../../code/e1/routing/config/routes_for_blog.rb:63
22.3 Helpers for Formatting, Linking, and Pagination
rails view
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
ln -s ~/git/rails vendor/rails
cp -v ../../code/e1/views/app/controllers/*.rb app/controllers
`../../code/e1/views/app/controllers/application.rb' -> `app/controllers/application.rb'
`../../code/e1/views/app/controllers/array_controller.rb' -> `app/controllers/array_controller.rb'
`../../code/e1/views/app/controllers/blog1_controller.rb' -> `app/controllers/blog1_controller.rb'
`../../code/e1/views/app/controllers/blog2_controller.rb' -> `app/controllers/blog2_controller.rb'
`../../code/e1/views/app/controllers/blog_controller.rb' -> `app/controllers/blog_controller.rb'
`../../code/e1/views/app/controllers/builder_controller.rb' -> `app/controllers/builder_controller.rb'
`../../code/e1/views/app/controllers/form_controller.rb' -> `app/controllers/form_controller.rb'
`../../code/e1/views/app/controllers/form_for_controller.rb' -> `app/controllers/form_for_controller.rb'
`../../code/e1/views/app/controllers/pager_controller.rb' -> `app/controllers/pager_controller.rb'
`../../code/e1/views/app/controllers/partial_controller.rb' -> `app/controllers/partial_controller.rb'
`../../code/e1/views/app/controllers/products_controller.rb' -> `app/controllers/products_controller.rb'
`../../code/e1/views/app/controllers/rhtml_controller.rb' -> `app/controllers/rhtml_controller.rb'
`../../code/e1/views/app/controllers/test_controller.rb' -> `app/controllers/test_controller.rb'
`../../code/e1/views/app/controllers/upload_controller.rb' -> `app/controllers/upload_controller.rb'
cp -v ../../code/e1/views/lib/*_template.rb lib
`../../code/e1/views/lib/eval_template.rb' -> `lib/eval_template.rb'
`../../code/e1/views/lib/rdoc_template.rb' -> `lib/rdoc_template.rb'
cp -vr ../../code/e1/views/app/views/pager app/views
`../../code/e1/views/app/views/pager' -> `app/views/pager'
`../../code/e1/views/app/views/pager/.svn' -> `app/views/pager/.svn'
`../../code/e1/views/app/views/pager/.svn/text-base' -> `app/views/pager/.svn/text-base'
`../../code/e1/views/app/views/pager/.svn/text-base/user_list.erb.svn-base' -> `app/views/pager/.svn/text-base/user_list.erb.svn-base'
`../../code/e1/views/app/views/pager/.svn/text-base/user_list.html.erb.svn-base' -> `app/views/pager/.svn/text-base/user_list.html.erb.svn-base'
`../../code/e1/views/app/views/pager/.svn/entries' -> `app/views/pager/.svn/entries'
`../../code/e1/views/app/views/pager/.svn/props' -> `app/views/pager/.svn/props'
`../../code/e1/views/app/views/pager/.svn/tmp' -> `app/views/pager/.svn/tmp'
`../../code/e1/views/app/views/pager/.svn/tmp/text-base' -> `app/views/pager/.svn/tmp/text-base'
`../../code/e1/views/app/views/pager/.svn/tmp/props' -> `app/views/pager/.svn/tmp/props'
`../../code/e1/views/app/views/pager/.svn/tmp/prop-base' -> `app/views/pager/.svn/tmp/prop-base'
`../../code/e1/views/app/views/pager/.svn/all-wcprops' -> `app/views/pager/.svn/all-wcprops'
`../../code/e1/views/app/views/pager/.svn/format' -> `app/views/pager/.svn/format'
`../../code/e1/views/app/views/pager/.svn/prop-base' -> `app/views/pager/.svn/prop-base'
`../../code/e1/views/app/views/pager/user_list.erb' -> `app/views/pager/user_list.erb'
`../../code/e1/views/app/views/pager/user_list.html.erb' -> `app/views/pager/user_list.html.erb'
ruby script/generate model user name:string
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/user.rb
create test/unit/user_test.rb
create test/fixtures/users.yml
create db/migrate
create db/migrate/20090309203326_create_users.rb
restart
rake db:migrate
mv 20090309203326_create_users.rb 20080601000001_create_users.rb
(in /home/rubys/svn/RAILS3/Book/util/view)
== CreateUsers: migrating ====================================================
-- create_table(:users)
-> 0.0093s
== CreateUsers: migrated (0.0094s) ===========================================
echo "PagerController.new.populate" | ruby script/console
>> PagerController.new.populate
=> 763
>>
get /pager/user_list
Name
Adam Keys
Andy Hunt
Brian Marick
Brian McCallister
Chad Fowler
Chris Pine
Daniel Berger
Dave Thomas
David Heinemeier Hansson
Eric Hodel
Esther Derby
Greg Wilson
James Gray
Jeffrey Fredrick
Johanna Rothman
Juliet Thomas
Maik Schmidt
Marcel Molina
Mike Clark
Mike Gunderloy
Mike Mason
Ryan Davis
Scott Barron
Scott Davis
Thomas Fuchs
ZZUser 000
ZZUser 001
ZZUser 002
ZZUser 003
ZZUser 004
get /pager/user_list?page=2
Name
ZZUser 005
ZZUser 006
ZZUser 007
ZZUser 008
ZZUser 009
ZZUser 010
ZZUser 011
ZZUser 012
ZZUser 013
ZZUser 014
ZZUser 015
ZZUser 016
ZZUser 017
ZZUser 018
ZZUser 019
ZZUser 020
ZZUser 021
ZZUser 022
ZZUser 023
ZZUser 024
ZZUser 025
ZZUser 026
ZZUser 027
ZZUser 028
ZZUser 029
ZZUser 030
ZZUser 031
ZZUser 032
ZZUser 033
ZZUser 034
22.5 Forms That Wrap Model Objects
ruby script/generate model product title:string description:text image_url:string price:decimal
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/product.rb
create test/unit/product_test.rb
create test/fixtures/products.yml
exists db/migrate
create db/migrate/20090309203349_create_products.rb
cp -v ../../code/e1/views/db/migrate/*products.rb db/migrate/*products.rb
`../../code/e1/views/db/migrate/002_create_products.rb' -> `db/migrate/20090309203349_create_products.rb'
cp -v ../../code/e1/views/app/models/shipping.rb app/models
`../../code/e1/views/app/models/shipping.rb' -> `app/models/shipping.rb'
ruby script/generate model detail product_id:integer sku:string manufacturer:string
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/detail.rb
create test/unit/detail_test.rb
create test/fixtures/details.yml
exists db/migrate
create db/migrate/20090309203350_create_details.rb
cp -v ../../code/e1/views/db/migrate/*details.rb db/migrate/*details.rb
`../../code/e1/views/db/migrate/004_create_details.rb' -> `db/migrate/20090309203350_create_details.rb'
cp -v ../../code/e1/views/app/models/detail.rb app/models
`../../code/e1/views/app/models/detail.rb' -> `app/models/detail.rb'
rake db:migrate
mv 20090309203349_create_products.rb 20080601000002_create_products.rb
mv 20090309203350_create_details.rb 20080601000003_create_details.rb
(in /home/rubys/svn/RAILS3/Book/util/view)
== CreateProducts: migrating =================================================
-- create_table(:products)
-> 0.0275s
== CreateProducts: migrated (0.0277s) ========================================
== CreateDetails: migrating ==================================================
-- create_table(:details)
-> 0.0166s
== CreateDetails: migrated (0.0168s) =========================================
cp -vr ../../code/e1/views/app/views/form_for app/views
`../../code/e1/views/app/views/form_for' -> `app/views/form_for'
`../../code/e1/views/app/views/form_for/.svn' -> `app/views/form_for/.svn'
`../../code/e1/views/app/views/form_for/.svn/text-base' -> `app/views/form_for/.svn/text-base'
`../../code/e1/views/app/views/form_for/.svn/text-base/new.html.erb.svn-base' -> `app/views/form_for/.svn/text-base/new.html.erb.svn-base'
`../../code/e1/views/app/views/form_for/.svn/text-base/create.html.erb.svn-base' -> `app/views/form_for/.svn/text-base/create.html.erb.svn-base'
`../../code/e1/views/app/views/form_for/.svn/entries' -> `app/views/form_for/.svn/entries'
`../../code/e1/views/app/views/form_for/.svn/props' -> `app/views/form_for/.svn/props'
`../../code/e1/views/app/views/form_for/.svn/tmp' -> `app/views/form_for/.svn/tmp'
`../../code/e1/views/app/views/form_for/.svn/tmp/text-base' -> `app/views/form_for/.svn/tmp/text-base'
`../../code/e1/views/app/views/form_for/.svn/tmp/props' -> `app/views/form_for/.svn/tmp/props'
`../../code/e1/views/app/views/form_for/.svn/tmp/prop-base' -> `app/views/form_for/.svn/tmp/prop-base'
`../../code/e1/views/app/views/form_for/.svn/all-wcprops' -> `app/views/form_for/.svn/all-wcprops'
`../../code/e1/views/app/views/form_for/.svn/format' -> `app/views/form_for/.svn/format'
`../../code/e1/views/app/views/form_for/.svn/prop-base' -> `app/views/form_for/.svn/prop-base'
`../../code/e1/views/app/views/form_for/new.html.erb' -> `app/views/form_for/new.html.erb'
`../../code/e1/views/app/views/form_for/create.html.erb' -> `app/views/form_for/create.html.erb'
get /form_for/new
cp -vr ../../code/e1/views/app/views/test app/views
`../../code/e1/views/app/views/test' -> `app/views/test'
`../../code/e1/views/app/views/test/date_dump.html.erb' -> `app/views/test/date_dump.html.erb'
`../../code/e1/views/app/views/test/example.rdoc' -> `app/views/test/example.rdoc'
`../../code/e1/views/app/views/test/test.html.erb' -> `app/views/test/test.html.erb'
`../../code/e1/views/app/views/test/.svn' -> `app/views/test/.svn'
`../../code/e1/views/app/views/test/.svn/text-base' -> `app/views/test/.svn/text-base'
`../../code/e1/views/app/views/test/.svn/text-base/date_dump.html.erb.svn-base' -> `app/views/test/.svn/text-base/date_dump.html.erb.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/date_format.reval.svn-base' -> `app/views/test/.svn/text-base/date_format.reval.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/dates.xml.builder.svn-base' -> `app/views/test/.svn/text-base/dates.xml.builder.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/date_tags.html.erb.svn-base' -> `app/views/test/.svn/text-base/date_tags.html.erb.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/objects.xml.builder.svn-base' -> `app/views/test/.svn/text-base/objects.xml.builder.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/select.html.erb.svn-base' -> `app/views/test/.svn/text-base/select.html.erb.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/example.rdoc.svn-base' -> `app/views/test/.svn/text-base/example.rdoc.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/numbers.xml.builder.svn-base' -> `app/views/test/.svn/text-base/numbers.xml.builder.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/calculate.html.erb.svn-base' -> `app/views/test/.svn/text-base/calculate.html.erb.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/text.xml.builder.svn-base' -> `app/views/test/.svn/text-base/text.xml.builder.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/test.html.erb.svn-base' -> `app/views/test/.svn/text-base/test.html.erb.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/calc.html.erb.svn-base' -> `app/views/test/.svn/text-base/calc.html.erb.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/t.html.erb.svn-base' -> `app/views/test/.svn/text-base/t.html.erb.svn-base'
`../../code/e1/views/app/views/test/.svn/text-base/example1.reval.svn-base' -> `app/views/test/.svn/text-base/example1.reval.svn-base'
`../../code/e1/views/app/views/test/.svn/entries' -> `app/views/test/.svn/entries'
`../../code/e1/views/app/views/test/.svn/props' -> `app/views/test/.svn/props'
`../../code/e1/views/app/views/test/.svn/tmp' -> `app/views/test/.svn/tmp'
`../../code/e1/views/app/views/test/.svn/tmp/text-base' -> `app/views/test/.svn/tmp/text-base'
`../../code/e1/views/app/views/test/.svn/tmp/props' -> `app/views/test/.svn/tmp/props'
`../../code/e1/views/app/views/test/.svn/tmp/prop-base' -> `app/views/test/.svn/tmp/prop-base'
`../../code/e1/views/app/views/test/.svn/all-wcprops' -> `app/views/test/.svn/all-wcprops'
`../../code/e1/views/app/views/test/.svn/format' -> `app/views/test/.svn/format'
`../../code/e1/views/app/views/test/.svn/prop-base' -> `app/views/test/.svn/prop-base'
`../../code/e1/views/app/views/test/example1.reval' -> `app/views/test/example1.reval'
`../../code/e1/views/app/views/test/t.html.erb' -> `app/views/test/t.html.erb'
`../../code/e1/views/app/views/test/numbers.xml.builder' -> `app/views/test/numbers.xml.builder'
`../../code/e1/views/app/views/test/text.xml.builder' -> `app/views/test/text.xml.builder'
`../../code/e1/views/app/views/test/objects.xml.builder' -> `app/views/test/objects.xml.builder'
`../../code/e1/views/app/views/test/date_format.reval' -> `app/views/test/date_format.reval'
`../../code/e1/views/app/views/test/dates.xml.builder' -> `app/views/test/dates.xml.builder'
`../../code/e1/views/app/views/test/date_tags.html.erb' -> `app/views/test/date_tags.html.erb'
`../../code/e1/views/app/views/test/calc.html.erb' -> `app/views/test/calc.html.erb'
`../../code/e1/views/app/views/test/calculate.html.erb' -> `app/views/test/calculate.html.erb'
`../../code/e1/views/app/views/test/select.html.erb' -> `app/views/test/select.html.erb'
get /test/select
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
NoMethodError in
Test#select
</h1>
<p>
Showing <i>app/views/test/select.html.erb</i> where line <b>#93</b> raised:
<pre><code>undefined method `country_select' for #<ActionView::Base:0x7fdb804268d8></code></pre>
</p>
<p>Extracted source (around line <b>#93</b>):
<pre><code>90: <p>&nbsp;</p>
91:
92:
93: <%= country_select(:user, :country) %>
94: <p>&nbsp;</p>
95:
96: <%= country_select(:user, :country, [ "United Kingom", "United States" ]) %>
</code></pre></p>
<p></p>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/view</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/view/app/views/test/select.html.erb:93:in `_run_erb_app47views47test47select46html46erb'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1329:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/view/app/views/test/select.html.erb:93:in `_run_erb_app47views47test47select46html46erb'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1329:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/view/app/views/test/select.html.erb:93:in `_run_erb_app47views47test47select46html46erb'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `send'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/renderable.rb:36:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/template.rb:194:in `render_template'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_view/base.rb:258:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1241:in `render_for_file'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:937:in `render_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1317:in `default_render'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:1329:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/view/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:1771:in `framework'
makedepot.rb:2331
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
cp -vr ../../code/e1/views/app/views/products app/views
`../../code/e1/views/app/views/products' -> `app/views/products'
`../../code/e1/views/app/views/products/.svn' -> `app/views/products/.svn'
`../../code/e1/views/app/views/products/.svn/text-base' -> `app/views/products/.svn/text-base'
`../../code/e1/views/app/views/products/.svn/text-base/new.html.erb.svn-base' -> `app/views/products/.svn/text-base/new.html.erb.svn-base'
`../../code/e1/views/app/views/products/.svn/text-base/show.html.erb.svn-base' -> `app/views/products/.svn/text-base/show.html.erb.svn-base'
`../../code/e1/views/app/views/products/.svn/text-base/create.html.erb.svn-base' -> `app/views/products/.svn/text-base/create.html.erb.svn-base'
`../../code/e1/views/app/views/products/.svn/entries' -> `app/views/products/.svn/entries'
`../../code/e1/views/app/views/products/.svn/props' -> `app/views/products/.svn/props'
`../../code/e1/views/app/views/products/.svn/tmp' -> `app/views/products/.svn/tmp'
`../../code/e1/views/app/views/products/.svn/tmp/text-base' -> `app/views/products/.svn/tmp/text-base'
`../../code/e1/views/app/views/products/.svn/tmp/props' -> `app/views/products/.svn/tmp/props'
`../../code/e1/views/app/views/products/.svn/tmp/prop-base' -> `app/views/products/.svn/tmp/prop-base'
`../../code/e1/views/app/views/products/.svn/all-wcprops' -> `app/views/products/.svn/all-wcprops'
`../../code/e1/views/app/views/products/.svn/format' -> `app/views/products/.svn/format'
`../../code/e1/views/app/views/products/.svn/prop-base' -> `app/views/products/.svn/prop-base'
`../../code/e1/views/app/views/products/new.html.erb' -> `app/views/products/new.html.erb'
`../../code/e1/views/app/views/products/show.html.erb' -> `app/views/products/show.html.erb'
`../../code/e1/views/app/views/products/create.html.erb' -> `app/views/products/create.html.erb'
get /products/new
22.6 Custom Form Builders
cp -vr ../../code/e1/views/app/helpers/tagged_builder.rb app/helpers
`../../code/e1/views/app/helpers/tagged_builder.rb' -> `app/helpers/tagged_builder.rb'
cp -vr ../../code/e1/views/app/views/builder app/views
`../../code/e1/views/app/views/builder' -> `app/views/builder'
`../../code/e1/views/app/views/builder/.svn' -> `app/views/builder/.svn'
`../../code/e1/views/app/views/builder/.svn/text-base' -> `app/views/builder/.svn/text-base'
`../../code/e1/views/app/views/builder/.svn/text-base/new_with_helper.html.erb.svn-base' -> `app/views/builder/.svn/text-base/new_with_helper.html.erb.svn-base'
`../../code/e1/views/app/views/builder/.svn/text-base/new.html.erb.svn-base' -> `app/views/builder/.svn/text-base/new.html.erb.svn-base'
`../../code/e1/views/app/views/builder/.svn/entries' -> `app/views/builder/.svn/entries'
`../../code/e1/views/app/views/builder/.svn/props' -> `app/views/builder/.svn/props'
`../../code/e1/views/app/views/builder/.svn/tmp' -> `app/views/builder/.svn/tmp'
`../../code/e1/views/app/views/builder/.svn/tmp/text-base' -> `app/views/builder/.svn/tmp/text-base'
`../../code/e1/views/app/views/builder/.svn/tmp/props' -> `app/views/builder/.svn/tmp/props'
`../../code/e1/views/app/views/builder/.svn/tmp/prop-base' -> `app/views/builder/.svn/tmp/prop-base'
`../../code/e1/views/app/views/builder/.svn/all-wcprops' -> `app/views/builder/.svn/all-wcprops'
`../../code/e1/views/app/views/builder/.svn/format' -> `app/views/builder/.svn/format'
`../../code/e1/views/app/views/builder/.svn/prop-base' -> `app/views/builder/.svn/prop-base'
`../../code/e1/views/app/views/builder/new.html.erb' -> `app/views/builder/new.html.erb'
`../../code/e1/views/app/views/builder/new_with_helper.html.erb' -> `app/views/builder/new_with_helper.html.erb'
get /builder/new
cp -vr ../../code/e1/views/app/helpers/builder_helper.rb app/helpers
`../../code/e1/views/app/helpers/builder_helper.rb' -> `app/helpers/builder_helper.rb'
get /builder/new_with_helper
cp -vr ../../code/e1/views/app/views/array app/views
`../../code/e1/views/app/views/array' -> `app/views/array'
`../../code/e1/views/app/views/array/.svn' -> `app/views/array/.svn'
`../../code/e1/views/app/views/array/.svn/text-base' -> `app/views/array/.svn/text-base'
`../../code/e1/views/app/views/array/.svn/text-base/edit.html.erb.svn-base' -> `app/views/array/.svn/text-base/edit.html.erb.svn-base'
`../../code/e1/views/app/views/array/.svn/entries' -> `app/views/array/.svn/entries'
`../../code/e1/views/app/views/array/.svn/props' -> `app/views/array/.svn/props'
`../../code/e1/views/app/views/array/.svn/tmp' -> `app/views/array/.svn/tmp'
`../../code/e1/views/app/views/array/.svn/tmp/text-base' -> `app/views/array/.svn/tmp/text-base'
`../../code/e1/views/app/views/array/.svn/tmp/props' -> `app/views/array/.svn/tmp/props'
`../../code/e1/views/app/views/array/.svn/tmp/prop-base' -> `app/views/array/.svn/tmp/prop-base'
`../../code/e1/views/app/views/array/.svn/all-wcprops' -> `app/views/array/.svn/all-wcprops'
`../../code/e1/views/app/views/array/.svn/format' -> `app/views/array/.svn/format'
`../../code/e1/views/app/views/array/.svn/prop-base' -> `app/views/array/.svn/prop-base'
`../../code/e1/views/app/views/array/edit.html.erb' -> `app/views/array/edit.html.erb'
get /array/edit
22.7 Working with Nonmodel Fields
get /test/calculate
22.8 Uploading Files to Rails Applications
ruby script/generate model picture comment:string name:string content_type:string data:binary
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/picture.rb
create test/unit/picture_test.rb
create test/fixtures/pictures.yml
exists db/migrate
create db/migrate/20090309203354_create_pictures.rb
cp -v ../../code/e1/views/db/migrate/*pictures.rb db/migrate/*pictures.rb
`../../code/e1/views/db/migrate/003_create_pictures.rb' -> `db/migrate/20090309203354_create_pictures.rb'
cp -v ../../code/e1/views/app/models/picture.rb app/models
`../../code/e1/views/app/models/picture.rb' -> `app/models/picture.rb'
rake db:migrate
mv 20090309203354_create_pictures.rb 20080601000004_create_pictures.rb
(in /home/rubys/svn/RAILS3/Book/util/view)
== CreatePictures: migrating =================================================
-- create_table(:pictures)
-> 0.0171s
== CreatePictures: migrated (0.0173s) ========================================
cp -vr ../../code/e1/views/app/views/upload app/views
`../../code/e1/views/app/views/upload' -> `app/views/upload'
`../../code/e1/views/app/views/upload/.svn' -> `app/views/upload/.svn'
`../../code/e1/views/app/views/upload/.svn/text-base' -> `app/views/upload/.svn/text-base'
`../../code/e1/views/app/views/upload/.svn/text-base/get.html.erb.svn-base' -> `app/views/upload/.svn/text-base/get.html.erb.svn-base'
`../../code/e1/views/app/views/upload/.svn/text-base/save.html.erb.svn-base' -> `app/views/upload/.svn/text-base/save.html.erb.svn-base'
`../../code/e1/views/app/views/upload/.svn/text-base/show.html.erb.svn-base' -> `app/views/upload/.svn/text-base/show.html.erb.svn-base'
`../../code/e1/views/app/views/upload/.svn/entries' -> `app/views/upload/.svn/entries'
`../../code/e1/views/app/views/upload/.svn/props' -> `app/views/upload/.svn/props'
`../../code/e1/views/app/views/upload/.svn/tmp' -> `app/views/upload/.svn/tmp'
`../../code/e1/views/app/views/upload/.svn/tmp/text-base' -> `app/views/upload/.svn/tmp/text-base'
`../../code/e1/views/app/views/upload/.svn/tmp/props' -> `app/views/upload/.svn/tmp/props'
`../../code/e1/views/app/views/upload/.svn/tmp/prop-base' -> `app/views/upload/.svn/tmp/prop-base'
`../../code/e1/views/app/views/upload/.svn/all-wcprops' -> `app/views/upload/.svn/all-wcprops'
`../../code/e1/views/app/views/upload/.svn/format' -> `app/views/upload/.svn/format'
`../../code/e1/views/app/views/upload/.svn/prop-base' -> `app/views/upload/.svn/prop-base'
`../../code/e1/views/app/views/upload/show.html.erb' -> `app/views/upload/show.html.erb'
`../../code/e1/views/app/views/upload/get.html.erb' -> `app/views/upload/get.html.erb'
`../../code/e1/views/app/views/upload/save.html.erb' -> `app/views/upload/save.html.erb'
get /upload/get
22.9 Layouts and Components
cp -vr ../../code/e1/views/app/views/partial app/views
`../../code/e1/views/app/views/partial' -> `app/views/partial'
`../../code/e1/views/app/views/partial/_animal.html.erb' -> `app/views/partial/_animal.html.erb'
`../../code/e1/views/app/views/partial/.svn' -> `app/views/partial/.svn'
`../../code/e1/views/app/views/partial/.svn/text-base' -> `app/views/partial/.svn/text-base'
`../../code/e1/views/app/views/partial/.svn/text-base/list.html.erb.svn-base' -> `app/views/partial/.svn/text-base/list.html.erb.svn-base'
`../../code/e1/views/app/views/partial/.svn/text-base/test1.html.erb.svn-base' -> `app/views/partial/.svn/text-base/test1.html.erb.svn-base'
`../../code/e1/views/app/views/partial/.svn/text-base/_partial.html.erb.svn-base' -> `app/views/partial/.svn/text-base/_partial.html.erb.svn-base'
`../../code/e1/views/app/views/partial/.svn/text-base/_spacer.html.erb.svn-base' -> `app/views/partial/.svn/text-base/_spacer.html.erb.svn-base'
`../../code/e1/views/app/views/partial/.svn/text-base/_animal.html.erb.svn-base' -> `app/views/partial/.svn/text-base/_animal.html.erb.svn-base'
`../../code/e1/views/app/views/partial/.svn/text-base/_article.html.erb.svn-base' -> `app/views/partial/.svn/text-base/_article.html.erb.svn-base'
`../../code/e1/views/app/views/partial/.svn/entries' -> `app/views/partial/.svn/entries'
`../../code/e1/views/app/views/partial/.svn/props' -> `app/views/partial/.svn/props'
`../../code/e1/views/app/views/partial/.svn/tmp' -> `app/views/partial/.svn/tmp'
`../../code/e1/views/app/views/partial/.svn/tmp/text-base' -> `app/views/partial/.svn/tmp/text-base'
`../../code/e1/views/app/views/partial/.svn/tmp/props' -> `app/views/partial/.svn/tmp/props'
`../../code/e1/views/app/views/partial/.svn/tmp/prop-base' -> `app/views/partial/.svn/tmp/prop-base'
`../../code/e1/views/app/views/partial/.svn/all-wcprops' -> `app/views/partial/.svn/all-wcprops'
`../../code/e1/views/app/views/partial/.svn/format' -> `app/views/partial/.svn/format'
`../../code/e1/views/app/views/partial/.svn/prop-base' -> `app/views/partial/.svn/prop-base'
`../../code/e1/views/app/views/partial/test1.html.erb' -> `app/views/partial/test1.html.erb'
`../../code/e1/views/app/views/partial/list.html.erb' -> `app/views/partial/list.html.erb'
`../../code/e1/views/app/views/partial/_article.html.erb' -> `app/views/partial/_article.html.erb'
`../../code/e1/views/app/views/partial/_spacer.html.erb' -> `app/views/partial/_spacer.html.erb'
`../../code/e1/views/app/views/partial/_partial.html.erb' -> `app/views/partial/_partial.html.erb'
get /partial/list
The animal is ant
The animal is bee
The animal is cat
The animal is dog
The animal is elk
22.10 Caching, Part Two
ruby script/generate model article body:text
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/article.rb
create test/unit/article_test.rb
create test/fixtures/articles.yml
exists db/migrate
create db/migrate/20090309203356_create_articles.rb
cp -v ../../code/e1/views/app/models/article.rb app/models
`../../code/e1/views/app/models/article.rb' -> `app/models/article.rb'
cp -vr ../../code/e1/views/app/views/blog app/views
`../../code/e1/views/app/views/blog' -> `app/views/blog'
`../../code/e1/views/app/views/blog/.svn' -> `app/views/blog/.svn'
`../../code/e1/views/app/views/blog/.svn/text-base' -> `app/views/blog/.svn/text-base'
`../../code/e1/views/app/views/blog/.svn/text-base/index.html.erb.svn-base' -> `app/views/blog/.svn/text-base/index.html.erb.svn-base'
`../../code/e1/views/app/views/blog/.svn/text-base/list.html.erb.svn-base' -> `app/views/blog/.svn/text-base/list.html.erb.svn-base'
`../../code/e1/views/app/views/blog/.svn/entries' -> `app/views/blog/.svn/entries'
`../../code/e1/views/app/views/blog/.svn/props' -> `app/views/blog/.svn/props'
`../../code/e1/views/app/views/blog/.svn/tmp' -> `app/views/blog/.svn/tmp'
`../../code/e1/views/app/views/blog/.svn/tmp/text-base' -> `app/views/blog/.svn/tmp/text-base'
`../../code/e1/views/app/views/blog/.svn/tmp/props' -> `app/views/blog/.svn/tmp/props'
`../../code/e1/views/app/views/blog/.svn/tmp/prop-base' -> `app/views/blog/.svn/tmp/prop-base'
`../../code/e1/views/app/views/blog/.svn/all-wcprops' -> `app/views/blog/.svn/all-wcprops'
`../../code/e1/views/app/views/blog/.svn/format' -> `app/views/blog/.svn/format'
`../../code/e1/views/app/views/blog/.svn/prop-base' -> `app/views/blog/.svn/prop-base'
`../../code/e1/views/app/views/blog/list.html.erb' -> `app/views/blog/list.html.erb'
`../../code/e1/views/app/views/blog/index.html.erb' -> `app/views/blog/index.html.erb'
get /blog/list
Mon Mar 09 16:33:56 -0400 2009
Mon Mar 09 16:33:56 -0400 2009
cp -vr ../../code/e1/views/app/views/blog1 app/views
`../../code/e1/views/app/views/blog1' -> `app/views/blog1'
`../../code/e1/views/app/views/blog1/.svn' -> `app/views/blog1/.svn'
`../../code/e1/views/app/views/blog1/.svn/text-base' -> `app/views/blog1/.svn/text-base'
`../../code/e1/views/app/views/blog1/.svn/text-base/list.html.erb.svn-base' -> `app/views/blog1/.svn/text-base/list.html.erb.svn-base'
`../../code/e1/views/app/views/blog1/.svn/entries' -> `app/views/blog1/.svn/entries'
`../../code/e1/views/app/views/blog1/.svn/props' -> `app/views/blog1/.svn/props'
`../../code/e1/views/app/views/blog1/.svn/tmp' -> `app/views/blog1/.svn/tmp'
`../../code/e1/views/app/views/blog1/.svn/tmp/text-base' -> `app/views/blog1/.svn/tmp/text-base'
`../../code/e1/views/app/views/blog1/.svn/tmp/props' -> `app/views/blog1/.svn/tmp/props'
`../../code/e1/views/app/views/blog1/.svn/tmp/prop-base' -> `app/views/blog1/.svn/tmp/prop-base'
`../../code/e1/views/app/views/blog1/.svn/all-wcprops' -> `app/views/blog1/.svn/all-wcprops'
`../../code/e1/views/app/views/blog1/.svn/format' -> `app/views/blog1/.svn/format'
`../../code/e1/views/app/views/blog1/.svn/prop-base' -> `app/views/blog1/.svn/prop-base'
`../../code/e1/views/app/views/blog1/list.html.erb' -> `app/views/blog1/list.html.erb'
get /blog1/list
Mon Mar 09 16:33:57 -0400 2009
Mon Mar 09 16:33:57 -0400 2009
cp -vr ../../code/e1/views/app/views/blog2 app/views
`../../code/e1/views/app/views/blog2' -> `app/views/blog2'
`../../code/e1/views/app/views/blog2/.svn' -> `app/views/blog2/.svn'
`../../code/e1/views/app/views/blog2/.svn/text-base' -> `app/views/blog2/.svn/text-base'
`../../code/e1/views/app/views/blog2/.svn/text-base/list.html.erb.svn-base' -> `app/views/blog2/.svn/text-base/list.html.erb.svn-base'
`../../code/e1/views/app/views/blog2/.svn/entries' -> `app/views/blog2/.svn/entries'
`../../code/e1/views/app/views/blog2/.svn/props' -> `app/views/blog2/.svn/props'
`../../code/e1/views/app/views/blog2/.svn/tmp' -> `app/views/blog2/.svn/tmp'
`../../code/e1/views/app/views/blog2/.svn/tmp/text-base' -> `app/views/blog2/.svn/tmp/text-base'
`../../code/e1/views/app/views/blog2/.svn/tmp/props' -> `app/views/blog2/.svn/tmp/props'
`../../code/e1/views/app/views/blog2/.svn/tmp/prop-base' -> `app/views/blog2/.svn/tmp/prop-base'
`../../code/e1/views/app/views/blog2/.svn/all-wcprops' -> `app/views/blog2/.svn/all-wcprops'
`../../code/e1/views/app/views/blog2/.svn/format' -> `app/views/blog2/.svn/format'
`../../code/e1/views/app/views/blog2/.svn/prop-base' -> `app/views/blog2/.svn/prop-base'
`../../code/e1/views/app/views/blog2/list.html.erb' -> `app/views/blog2/list.html.erb'
get /blog2/list
There are a total of 4 articles.
22.11 Adding New Templating Systems
get /test/example
Unknown action
No action responded to example. Actions: calculate, date_dump, and rdoc
get /test/date_format
Unknown action
No action responded to date_format. Actions: calculate, date_dump, and rdoc
get /test/example1
Unknown action
No action responded to example1. Actions: calculate, date_dump, and rdoc
23.1 Prototype
rails pragforms
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
ln -s ~/git/rails vendor/rails
ruby script/generate model user username:string favorite_language:string lock_version:integer
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/user.rb
create test/unit/user_test.rb
create test/fixtures/users.yml
create db/migrate
create db/migrate/20090309203358_create_users.rb
cp -v ../../code/pragforms/db/migrate/*user* db/migrate/*user*
`../../code/pragforms/db/migrate/001_create_users.rb' -> `db/migrate/20090309203358_create_users.rb'
cp -v ../../code/pragforms/app/models/*user* app/models
`../../code/pragforms/app/models/user.rb' -> `app/models/user.rb'
ruby script/generate model language name:string shortest_wiki:integer
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/language.rb
create test/unit/language_test.rb
create test/fixtures/languages.yml
exists db/migrate
create db/migrate/20090309203359_create_languages.rb
ruby script/generate model accolade name:string received:date user_id:integer
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/accolade.rb
create test/unit/accolade_test.rb
create test/fixtures/accolades.yml
exists db/migrate
create db/migrate/20090309203400_create_accolades.rb
ruby script/generate model todo name:string completed:datetime user_id:integer position:integer
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/todo.rb
create test/unit/todo_test.rb
create test/fixtures/todos.yml
exists db/migrate
create db/migrate/20090309203401_create_todos.rb
ruby script/generate model zip zip:string city:string state:string lock_version:integer
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/zip.rb
create test/unit/zip_test.rb
create test/fixtures/zips.yml
exists db/migrate
create db/migrate/20090309203402_create_zips.rb
ruby script/generate migration AddHomeZips
exists db/migrate
create db/migrate/20090309203403_add_home_zips.rb
cp -v ../../code/pragforms/db/migrate/*add_home_zips* db/migrate/*add_home_zips*
`../../code/pragforms/db/migrate/006_add_home_zips.rb' -> `db/migrate/20090309203403_add_home_zips.rb'
cp -vr ../../code/pragforms/vendor/plugins vendor
`../../code/pragforms/vendor/plugins/in_place_editing' -> `vendor/plugins/in_place_editing'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn' -> `vendor/plugins/in_place_editing/.svn'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/text-base' -> `vendor/plugins/in_place_editing/.svn/text-base'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/text-base/Rakefile.svn-base' -> `vendor/plugins/in_place_editing/.svn/text-base/Rakefile.svn-base'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/text-base/init.rb.svn-base' -> `vendor/plugins/in_place_editing/.svn/text-base/init.rb.svn-base'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/text-base/README.svn-base' -> `vendor/plugins/in_place_editing/.svn/text-base/README.svn-base'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/entries' -> `vendor/plugins/in_place_editing/.svn/entries'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/props' -> `vendor/plugins/in_place_editing/.svn/props'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/tmp' -> `vendor/plugins/in_place_editing/.svn/tmp'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/tmp/text-base' -> `vendor/plugins/in_place_editing/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/tmp/props' -> `vendor/plugins/in_place_editing/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/tmp/prop-base' -> `vendor/plugins/in_place_editing/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/all-wcprops' -> `vendor/plugins/in_place_editing/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/format' -> `vendor/plugins/in_place_editing/.svn/format'
`../../code/pragforms/vendor/plugins/in_place_editing/.svn/prop-base' -> `vendor/plugins/in_place_editing/.svn/prop-base'
`../../code/pragforms/vendor/plugins/in_place_editing/test' -> `vendor/plugins/in_place_editing/test'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn' -> `vendor/plugins/in_place_editing/test/.svn'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/text-base' -> `vendor/plugins/in_place_editing/test/.svn/text-base'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/text-base/in_place_editing_test.rb.svn-base' -> `vendor/plugins/in_place_editing/test/.svn/text-base/in_place_editing_test.rb.svn-base'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/text-base/test_helper.rb.svn-base' -> `vendor/plugins/in_place_editing/test/.svn/text-base/test_helper.rb.svn-base'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/entries' -> `vendor/plugins/in_place_editing/test/.svn/entries'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/props' -> `vendor/plugins/in_place_editing/test/.svn/props'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/tmp' -> `vendor/plugins/in_place_editing/test/.svn/tmp'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/tmp/text-base' -> `vendor/plugins/in_place_editing/test/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/tmp/props' -> `vendor/plugins/in_place_editing/test/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/tmp/prop-base' -> `vendor/plugins/in_place_editing/test/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/all-wcprops' -> `vendor/plugins/in_place_editing/test/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/format' -> `vendor/plugins/in_place_editing/test/.svn/format'
`../../code/pragforms/vendor/plugins/in_place_editing/test/.svn/prop-base' -> `vendor/plugins/in_place_editing/test/.svn/prop-base'
`../../code/pragforms/vendor/plugins/in_place_editing/test/in_place_editing_test.rb' -> `vendor/plugins/in_place_editing/test/in_place_editing_test.rb'
`../../code/pragforms/vendor/plugins/in_place_editing/test/test_helper.rb' -> `vendor/plugins/in_place_editing/test/test_helper.rb'
`../../code/pragforms/vendor/plugins/in_place_editing/lib' -> `vendor/plugins/in_place_editing/lib'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn' -> `vendor/plugins/in_place_editing/lib/.svn'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/text-base' -> `vendor/plugins/in_place_editing/lib/.svn/text-base'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/text-base/in_place_editing.rb.svn-base' -> `vendor/plugins/in_place_editing/lib/.svn/text-base/in_place_editing.rb.svn-base'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/text-base/in_place_macros_helper.rb.svn-base' -> `vendor/plugins/in_place_editing/lib/.svn/text-base/in_place_macros_helper.rb.svn-base'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/entries' -> `vendor/plugins/in_place_editing/lib/.svn/entries'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/props' -> `vendor/plugins/in_place_editing/lib/.svn/props'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/tmp' -> `vendor/plugins/in_place_editing/lib/.svn/tmp'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/tmp/text-base' -> `vendor/plugins/in_place_editing/lib/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/tmp/props' -> `vendor/plugins/in_place_editing/lib/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/tmp/prop-base' -> `vendor/plugins/in_place_editing/lib/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/all-wcprops' -> `vendor/plugins/in_place_editing/lib/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/format' -> `vendor/plugins/in_place_editing/lib/.svn/format'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/.svn/prop-base' -> `vendor/plugins/in_place_editing/lib/.svn/prop-base'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/in_place_editing.rb' -> `vendor/plugins/in_place_editing/lib/in_place_editing.rb'
`../../code/pragforms/vendor/plugins/in_place_editing/lib/in_place_macros_helper.rb' -> `vendor/plugins/in_place_editing/lib/in_place_macros_helper.rb'
`../../code/pragforms/vendor/plugins/in_place_editing/init.rb' -> `vendor/plugins/in_place_editing/init.rb'
`../../code/pragforms/vendor/plugins/in_place_editing/README' -> `vendor/plugins/in_place_editing/README'
`../../code/pragforms/vendor/plugins/in_place_editing/Rakefile' -> `vendor/plugins/in_place_editing/Rakefile'
`../../code/pragforms/vendor/plugins/.svn' -> `vendor/plugins/.svn'
`../../code/pragforms/vendor/plugins/.svn/text-base' -> `vendor/plugins/.svn/text-base'
`../../code/pragforms/vendor/plugins/.svn/entries' -> `vendor/plugins/.svn/entries'
`../../code/pragforms/vendor/plugins/.svn/props' -> `vendor/plugins/.svn/props'
`../../code/pragforms/vendor/plugins/.svn/tmp' -> `vendor/plugins/.svn/tmp'
`../../code/pragforms/vendor/plugins/.svn/tmp/text-base' -> `vendor/plugins/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/.svn/tmp/props' -> `vendor/plugins/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/.svn/tmp/prop-base' -> `vendor/plugins/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/.svn/all-wcprops' -> `vendor/plugins/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/.svn/format' -> `vendor/plugins/.svn/format'
`../../code/pragforms/vendor/plugins/.svn/prop-base' -> `vendor/plugins/.svn/prop-base'
`../../code/pragforms/vendor/plugins/auto_complete' -> `vendor/plugins/auto_complete'
`../../code/pragforms/vendor/plugins/auto_complete/.svn' -> `vendor/plugins/auto_complete/.svn'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/text-base' -> `vendor/plugins/auto_complete/.svn/text-base'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/text-base/Rakefile.svn-base' -> `vendor/plugins/auto_complete/.svn/text-base/Rakefile.svn-base'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/text-base/init.rb.svn-base' -> `vendor/plugins/auto_complete/.svn/text-base/init.rb.svn-base'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/text-base/README.svn-base' -> `vendor/plugins/auto_complete/.svn/text-base/README.svn-base'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/entries' -> `vendor/plugins/auto_complete/.svn/entries'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/props' -> `vendor/plugins/auto_complete/.svn/props'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/tmp' -> `vendor/plugins/auto_complete/.svn/tmp'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/tmp/text-base' -> `vendor/plugins/auto_complete/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/tmp/props' -> `vendor/plugins/auto_complete/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/tmp/prop-base' -> `vendor/plugins/auto_complete/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/all-wcprops' -> `vendor/plugins/auto_complete/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/format' -> `vendor/plugins/auto_complete/.svn/format'
`../../code/pragforms/vendor/plugins/auto_complete/.svn/prop-base' -> `vendor/plugins/auto_complete/.svn/prop-base'
`../../code/pragforms/vendor/plugins/auto_complete/test' -> `vendor/plugins/auto_complete/test'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn' -> `vendor/plugins/auto_complete/test/.svn'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/text-base' -> `vendor/plugins/auto_complete/test/.svn/text-base'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/text-base/auto_complete_test.rb.svn-base' -> `vendor/plugins/auto_complete/test/.svn/text-base/auto_complete_test.rb.svn-base'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/entries' -> `vendor/plugins/auto_complete/test/.svn/entries'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/props' -> `vendor/plugins/auto_complete/test/.svn/props'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/tmp' -> `vendor/plugins/auto_complete/test/.svn/tmp'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/tmp/text-base' -> `vendor/plugins/auto_complete/test/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/tmp/props' -> `vendor/plugins/auto_complete/test/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/tmp/prop-base' -> `vendor/plugins/auto_complete/test/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/all-wcprops' -> `vendor/plugins/auto_complete/test/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/format' -> `vendor/plugins/auto_complete/test/.svn/format'
`../../code/pragforms/vendor/plugins/auto_complete/test/.svn/prop-base' -> `vendor/plugins/auto_complete/test/.svn/prop-base'
`../../code/pragforms/vendor/plugins/auto_complete/test/auto_complete_test.rb' -> `vendor/plugins/auto_complete/test/auto_complete_test.rb'
`../../code/pragforms/vendor/plugins/auto_complete/lib' -> `vendor/plugins/auto_complete/lib'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn' -> `vendor/plugins/auto_complete/lib/.svn'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/text-base' -> `vendor/plugins/auto_complete/lib/.svn/text-base'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/text-base/auto_complete.rb.svn-base' -> `vendor/plugins/auto_complete/lib/.svn/text-base/auto_complete.rb.svn-base'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/text-base/auto_complete_macros_helper.rb.svn-base' -> `vendor/plugins/auto_complete/lib/.svn/text-base/auto_complete_macros_helper.rb.svn-base'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/entries' -> `vendor/plugins/auto_complete/lib/.svn/entries'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/props' -> `vendor/plugins/auto_complete/lib/.svn/props'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/tmp' -> `vendor/plugins/auto_complete/lib/.svn/tmp'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/tmp/text-base' -> `vendor/plugins/auto_complete/lib/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/tmp/props' -> `vendor/plugins/auto_complete/lib/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/tmp/prop-base' -> `vendor/plugins/auto_complete/lib/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/all-wcprops' -> `vendor/plugins/auto_complete/lib/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/format' -> `vendor/plugins/auto_complete/lib/.svn/format'
`../../code/pragforms/vendor/plugins/auto_complete/lib/.svn/prop-base' -> `vendor/plugins/auto_complete/lib/.svn/prop-base'
`../../code/pragforms/vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb' -> `vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb'
`../../code/pragforms/vendor/plugins/auto_complete/lib/auto_complete.rb' -> `vendor/plugins/auto_complete/lib/auto_complete.rb'
`../../code/pragforms/vendor/plugins/auto_complete/init.rb' -> `vendor/plugins/auto_complete/init.rb'
`../../code/pragforms/vendor/plugins/auto_complete/README' -> `vendor/plugins/auto_complete/README'
`../../code/pragforms/vendor/plugins/auto_complete/Rakefile' -> `vendor/plugins/auto_complete/Rakefile'
`../../code/pragforms/vendor/plugins/relevance_extensions' -> `vendor/plugins/relevance_extensions'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn' -> `vendor/plugins/relevance_extensions/.svn'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/text-base' -> `vendor/plugins/relevance_extensions/.svn/text-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/text-base/Rakefile.svn-base' -> `vendor/plugins/relevance_extensions/.svn/text-base/Rakefile.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/text-base/install.rb.svn-base' -> `vendor/plugins/relevance_extensions/.svn/text-base/install.rb.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/text-base/init.rb.svn-base' -> `vendor/plugins/relevance_extensions/.svn/text-base/init.rb.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/text-base/README.svn-base' -> `vendor/plugins/relevance_extensions/.svn/text-base/README.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/text-base/to_include.jbg.svn-base' -> `vendor/plugins/relevance_extensions/.svn/text-base/to_include.jbg.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/entries' -> `vendor/plugins/relevance_extensions/.svn/entries'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/props' -> `vendor/plugins/relevance_extensions/.svn/props'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/tmp' -> `vendor/plugins/relevance_extensions/.svn/tmp'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/tmp/text-base' -> `vendor/plugins/relevance_extensions/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/tmp/props' -> `vendor/plugins/relevance_extensions/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/tmp/prop-base' -> `vendor/plugins/relevance_extensions/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/all-wcprops' -> `vendor/plugins/relevance_extensions/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/format' -> `vendor/plugins/relevance_extensions/.svn/format'
`../../code/pragforms/vendor/plugins/relevance_extensions/.svn/prop-base' -> `vendor/plugins/relevance_extensions/.svn/prop-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/test' -> `vendor/plugins/relevance_extensions/test'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn' -> `vendor/plugins/relevance_extensions/test/.svn'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/text-base' -> `vendor/plugins/relevance_extensions/test/.svn/text-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/text-base/relevance_extensions_test.rb.svn-base' -> `vendor/plugins/relevance_extensions/test/.svn/text-base/relevance_extensions_test.rb.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/entries' -> `vendor/plugins/relevance_extensions/test/.svn/entries'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/props' -> `vendor/plugins/relevance_extensions/test/.svn/props'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/tmp' -> `vendor/plugins/relevance_extensions/test/.svn/tmp'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/tmp/text-base' -> `vendor/plugins/relevance_extensions/test/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/tmp/props' -> `vendor/plugins/relevance_extensions/test/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/tmp/prop-base' -> `vendor/plugins/relevance_extensions/test/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/all-wcprops' -> `vendor/plugins/relevance_extensions/test/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/format' -> `vendor/plugins/relevance_extensions/test/.svn/format'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/.svn/prop-base' -> `vendor/plugins/relevance_extensions/test/.svn/prop-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/test/relevance_extensions_test.rb' -> `vendor/plugins/relevance_extensions/test/relevance_extensions_test.rb'
`../../code/pragforms/vendor/plugins/relevance_extensions/install.rb' -> `vendor/plugins/relevance_extensions/install.rb'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib' -> `vendor/plugins/relevance_extensions/lib'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/relevance_extensions.rb' -> `vendor/plugins/relevance_extensions/lib/relevance_extensions.rb'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn' -> `vendor/plugins/relevance_extensions/lib/.svn'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/text-base' -> `vendor/plugins/relevance_extensions/lib/.svn/text-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/text-base/relevance_extensions.rb.svn-base' -> `vendor/plugins/relevance_extensions/lib/.svn/text-base/relevance_extensions.rb.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/text-base/active_record_extensions.rb.svn-base' -> `vendor/plugins/relevance_extensions/lib/.svn/text-base/active_record_extensions.rb.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/text-base/streamlined_form_builder.rb.svn-base' -> `vendor/plugins/relevance_extensions/lib/.svn/text-base/streamlined_form_builder.rb.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/entries' -> `vendor/plugins/relevance_extensions/lib/.svn/entries'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/props' -> `vendor/plugins/relevance_extensions/lib/.svn/props'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/tmp' -> `vendor/plugins/relevance_extensions/lib/.svn/tmp'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/tmp/text-base' -> `vendor/plugins/relevance_extensions/lib/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/tmp/props' -> `vendor/plugins/relevance_extensions/lib/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/tmp/prop-base' -> `vendor/plugins/relevance_extensions/lib/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/all-wcprops' -> `vendor/plugins/relevance_extensions/lib/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/format' -> `vendor/plugins/relevance_extensions/lib/.svn/format'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/.svn/prop-base' -> `vendor/plugins/relevance_extensions/lib/.svn/prop-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/active_record_extensions.rb' -> `vendor/plugins/relevance_extensions/lib/active_record_extensions.rb'
`../../code/pragforms/vendor/plugins/relevance_extensions/lib/streamlined_form_builder.rb' -> `vendor/plugins/relevance_extensions/lib/streamlined_form_builder.rb'
`../../code/pragforms/vendor/plugins/relevance_extensions/init.rb' -> `vendor/plugins/relevance_extensions/init.rb'
`../../code/pragforms/vendor/plugins/relevance_extensions/README' -> `vendor/plugins/relevance_extensions/README'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks' -> `vendor/plugins/relevance_extensions/tasks'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn' -> `vendor/plugins/relevance_extensions/tasks/.svn'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/text-base' -> `vendor/plugins/relevance_extensions/tasks/.svn/text-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/text-base/relevance_extensions_tasks.rake.svn-base' -> `vendor/plugins/relevance_extensions/tasks/.svn/text-base/relevance_extensions_tasks.rake.svn-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/entries' -> `vendor/plugins/relevance_extensions/tasks/.svn/entries'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/props' -> `vendor/plugins/relevance_extensions/tasks/.svn/props'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/tmp' -> `vendor/plugins/relevance_extensions/tasks/.svn/tmp'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/tmp/text-base' -> `vendor/plugins/relevance_extensions/tasks/.svn/tmp/text-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/tmp/props' -> `vendor/plugins/relevance_extensions/tasks/.svn/tmp/props'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/tmp/prop-base' -> `vendor/plugins/relevance_extensions/tasks/.svn/tmp/prop-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/all-wcprops' -> `vendor/plugins/relevance_extensions/tasks/.svn/all-wcprops'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/format' -> `vendor/plugins/relevance_extensions/tasks/.svn/format'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/.svn/prop-base' -> `vendor/plugins/relevance_extensions/tasks/.svn/prop-base'
`../../code/pragforms/vendor/plugins/relevance_extensions/tasks/relevance_extensions_tasks.rake' -> `vendor/plugins/relevance_extensions/tasks/relevance_extensions_tasks.rake'
`../../code/pragforms/vendor/plugins/relevance_extensions/Rakefile' -> `vendor/plugins/relevance_extensions/Rakefile'
`../../code/pragforms/vendor/plugins/relevance_extensions/to_include.jbg' -> `vendor/plugins/relevance_extensions/to_include.jbg'
restart
rake db:migrate
mv 20090309203358_create_users.rb 20080601000001_create_users.rb
mv 20090309203359_create_languages.rb 20080601000002_create_languages.rb
mv 20090309203400_create_accolades.rb 20080601000003_create_accolades.rb
mv 20090309203401_create_todos.rb 20080601000004_create_todos.rb
mv 20090309203402_create_zips.rb 20080601000005_create_zips.rb
mv 20090309203403_add_home_zips.rb 20080601000006_add_home_zips.rb
(in /home/rubys/svn/RAILS3/Book/util/pragforms)
== CreateUsers: migrating ====================================================
-- create_table(:users)
-> 0.0200s
== CreateUsers: migrated (0.0201s) ===========================================
== CreateLanguages: migrating ================================================
-- create_table(:languages)
-> 0.0079s
== CreateLanguages: migrated (0.0080s) =======================================
== CreateAccolades: migrating ================================================
-- create_table(:accolades)
-> 0.0073s
== CreateAccolades: migrated (0.0074s) =======================================
== CreateTodos: migrating ====================================================
-- create_table(:todos)
-> 0.0126s
== CreateTodos: migrated (0.0127s) ===========================================
== CreateZips: migrating =====================================================
-- create_table(:zips)
-> 0.0111s
== CreateZips: migrated (0.0113s) ============================================
== AddHomeZips: migrating ====================================================
== AddHomeZips: migrated (0.0298s) ===========================================
cp -v ../../code/pragforms/app/controllers/*.rb app/controllers
`../../code/pragforms/app/controllers/accolade_controller.rb' -> `app/controllers/accolade_controller.rb'
`../../code/pragforms/app/controllers/application.rb' -> `app/controllers/application.rb'
`../../code/pragforms/app/controllers/language_controller.rb' -> `app/controllers/language_controller.rb'
`../../code/pragforms/app/controllers/nav_controller.rb' -> `app/controllers/nav_controller.rb'
`../../code/pragforms/app/controllers/random_controller.rb' -> `app/controllers/random_controller.rb'
`../../code/pragforms/app/controllers/user_controller.rb' -> `app/controllers/user_controller.rb'
`../../code/pragforms/app/controllers/zip_controller.rb' -> `app/controllers/zip_controller.rb'
cp -vr ../../code/pragforms/app/views/user app/views
`../../code/pragforms/app/views/user' -> `app/views/user'
`../../code/pragforms/app/views/user/autocomplete_demo.html.erb' -> `app/views/user/autocomplete_demo.html.erb'
`../../code/pragforms/app/views/user/_form.html.erb' -> `app/views/user/_form.html.erb'
`../../code/pragforms/app/views/user/_users.html.erb' -> `app/views/user/_users.html.erb'
`../../code/pragforms/app/views/user/rjs_demo.html.erb' -> `app/views/user/rjs_demo.html.erb'
`../../code/pragforms/app/views/user/.svn' -> `app/views/user/.svn'
`../../code/pragforms/app/views/user/.svn/text-base' -> `app/views/user/.svn/text-base'
`../../code/pragforms/app/views/user/.svn/text-base/search_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/search_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/drag_demo_effect.html.erb.svn-base' -> `app/views/user/.svn/text-base/drag_demo_effect.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/edit.html.erb.svn-base' -> `app/views/user/.svn/text-base/edit.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/sortable_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/sortable_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/sortable_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/sortable_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/list.html.erb.svn-base' -> `app/views/user/.svn/text-base/list.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/inplace_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/inplace_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/expando_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/expando_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/todo_completed.js.rjs.svn-base' -> `app/views/user/.svn/text-base/todo_completed.js.rjs.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/new.html.erb.svn-base' -> `app/views/user/.svn/text-base/new.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/autocomplete_favorite_language.html.erb.svn-base' -> `app/views/user/.svn/text-base/autocomplete_favorite_language.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/drag_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/drag_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/show_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/show_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/list_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/list_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/_pending_todos.html.erb.svn-base' -> `app/views/user/.svn/text-base/_pending_todos.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/search_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/search_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/_search.html.erb.svn-base' -> `app/views/user/.svn/text-base/_search.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/show.html.erb.svn-base' -> `app/views/user/.svn/text-base/show.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/sort_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/sort_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/list_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/list_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/drag_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/drag_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/_accolades_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/_accolades_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/_sort.html.erb.svn-base' -> `app/views/user/.svn/text-base/_sort.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/autocomplete_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/autocomplete_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/expando_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/expando_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/inplace_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/inplace_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/_accolades.html.erb.svn-base' -> `app/views/user/.svn/text-base/_accolades.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/_form.html.erb.svn-base' -> `app/views/user/.svn/text-base/_form.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/sort_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/sort_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/_completed_todos.html.erb.svn-base' -> `app/views/user/.svn/text-base/_completed_todos.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/autocomplete_before.html.erb.svn-base' -> `app/views/user/.svn/text-base/autocomplete_before.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/rjs_demo.html.erb.svn-base' -> `app/views/user/.svn/text-base/rjs_demo.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/text-base/_users.html.erb.svn-base' -> `app/views/user/.svn/text-base/_users.html.erb.svn-base'
`../../code/pragforms/app/views/user/.svn/entries' -> `app/views/user/.svn/entries'
`../../code/pragforms/app/views/user/.svn/props' -> `app/views/user/.svn/props'
`../../code/pragforms/app/views/user/.svn/tmp' -> `app/views/user/.svn/tmp'
`../../code/pragforms/app/views/user/.svn/tmp/text-base' -> `app/views/user/.svn/tmp/text-base'
`../../code/pragforms/app/views/user/.svn/tmp/props' -> `app/views/user/.svn/tmp/props'
`../../code/pragforms/app/views/user/.svn/tmp/prop-base' -> `app/views/user/.svn/tmp/prop-base'
`../../code/pragforms/app/views/user/.svn/all-wcprops' -> `app/views/user/.svn/all-wcprops'
`../../code/pragforms/app/views/user/.svn/format' -> `app/views/user/.svn/format'
`../../code/pragforms/app/views/user/.svn/prop-base' -> `app/views/user/.svn/prop-base'
`../../code/pragforms/app/views/user/expando_demo.html.erb' -> `app/views/user/expando_demo.html.erb'
`../../code/pragforms/app/views/user/_completed_todos.html.erb' -> `app/views/user/_completed_todos.html.erb'
`../../code/pragforms/app/views/user/new.html.erb' -> `app/views/user/new.html.erb'
`../../code/pragforms/app/views/user/list_before.html.erb' -> `app/views/user/list_before.html.erb'
`../../code/pragforms/app/views/user/drag_demo.html.erb' -> `app/views/user/drag_demo.html.erb'
`../../code/pragforms/app/views/user/inplace_before.html.erb' -> `app/views/user/inplace_before.html.erb'
`../../code/pragforms/app/views/user/search_before.html.erb' -> `app/views/user/search_before.html.erb'
`../../code/pragforms/app/views/user/list_demo.html.erb' -> `app/views/user/list_demo.html.erb'
`../../code/pragforms/app/views/user/list.html.erb' -> `app/views/user/list.html.erb'
`../../code/pragforms/app/views/user/expando_before.html.erb' -> `app/views/user/expando_before.html.erb'
`../../code/pragforms/app/views/user/sort_before.html.erb' -> `app/views/user/sort_before.html.erb'
`../../code/pragforms/app/views/user/show.html.erb' -> `app/views/user/show.html.erb'
`../../code/pragforms/app/views/user/autocomplete_favorite_language.html.erb' -> `app/views/user/autocomplete_favorite_language.html.erb'
`../../code/pragforms/app/views/user/_pending_todos.html.erb' -> `app/views/user/_pending_todos.html.erb'
`../../code/pragforms/app/views/user/autocomplete_before.html.erb' -> `app/views/user/autocomplete_before.html.erb'
`../../code/pragforms/app/views/user/inplace_demo.html.erb' -> `app/views/user/inplace_demo.html.erb'
`../../code/pragforms/app/views/user/show_demo.html.erb' -> `app/views/user/show_demo.html.erb'
`../../code/pragforms/app/views/user/search_demo.html.erb' -> `app/views/user/search_demo.html.erb'
`../../code/pragforms/app/views/user/_accolades_before.html.erb' -> `app/views/user/_accolades_before.html.erb'
`../../code/pragforms/app/views/user/todo_completed.js.rjs' -> `app/views/user/todo_completed.js.rjs'
`../../code/pragforms/app/views/user/_search.html.erb' -> `app/views/user/_search.html.erb'
`../../code/pragforms/app/views/user/_accolades.html.erb' -> `app/views/user/_accolades.html.erb'
`../../code/pragforms/app/views/user/drag_demo_effect.html.erb' -> `app/views/user/drag_demo_effect.html.erb'
`../../code/pragforms/app/views/user/drag_before.html.erb' -> `app/views/user/drag_before.html.erb'
`../../code/pragforms/app/views/user/_sort.html.erb' -> `app/views/user/_sort.html.erb'
`../../code/pragforms/app/views/user/sort_demo.html.erb' -> `app/views/user/sort_demo.html.erb'
`../../code/pragforms/app/views/user/sortable_before.html.erb' -> `app/views/user/sortable_before.html.erb'
`../../code/pragforms/app/views/user/sortable_demo.html.erb' -> `app/views/user/sortable_demo.html.erb'
`../../code/pragforms/app/views/user/edit.html.erb' -> `app/views/user/edit.html.erb'
cp -vr ../../code/pragforms/app/helpers app
`../../code/pragforms/app/helpers/.svn' -> `app/helpers/.svn'
`../../code/pragforms/app/helpers/.svn/text-base' -> `app/helpers/.svn/text-base'
`../../code/pragforms/app/helpers/.svn/text-base/user_helper.rb.svn-base' -> `app/helpers/.svn/text-base/user_helper.rb.svn-base'
`../../code/pragforms/app/helpers/.svn/text-base/zip_helper.rb.svn-base' -> `app/helpers/.svn/text-base/zip_helper.rb.svn-base'
`../../code/pragforms/app/helpers/.svn/text-base/favorite_language.rb.svn-base' -> `app/helpers/.svn/text-base/favorite_language.rb.svn-base'
`../../code/pragforms/app/helpers/.svn/text-base/nav_helper.rb.svn-base' -> `app/helpers/.svn/text-base/nav_helper.rb.svn-base'
`../../code/pragforms/app/helpers/.svn/text-base/language_helper.rb.svn-base' -> `app/helpers/.svn/text-base/language_helper.rb.svn-base'
`../../code/pragforms/app/helpers/.svn/text-base/random_helper.rb.svn-base' -> `app/helpers/.svn/text-base/random_helper.rb.svn-base'
`../../code/pragforms/app/helpers/.svn/text-base/accolade_helper.rb.svn-base' -> `app/helpers/.svn/text-base/accolade_helper.rb.svn-base'
`../../code/pragforms/app/helpers/.svn/text-base/application_helper.rb.svn-base' -> `app/helpers/.svn/text-base/application_helper.rb.svn-base'
`../../code/pragforms/app/helpers/.svn/entries' -> `app/helpers/.svn/entries'
`../../code/pragforms/app/helpers/.svn/props' -> `app/helpers/.svn/props'
`../../code/pragforms/app/helpers/.svn/tmp' -> `app/helpers/.svn/tmp'
`../../code/pragforms/app/helpers/.svn/tmp/text-base' -> `app/helpers/.svn/tmp/text-base'
`../../code/pragforms/app/helpers/.svn/tmp/props' -> `app/helpers/.svn/tmp/props'
`../../code/pragforms/app/helpers/.svn/tmp/prop-base' -> `app/helpers/.svn/tmp/prop-base'
`../../code/pragforms/app/helpers/.svn/all-wcprops' -> `app/helpers/.svn/all-wcprops'
`../../code/pragforms/app/helpers/.svn/format' -> `app/helpers/.svn/format'
`../../code/pragforms/app/helpers/.svn/prop-base' -> `app/helpers/.svn/prop-base'
`../../code/pragforms/app/helpers/nav_helper.rb' -> `app/helpers/nav_helper.rb'
`../../code/pragforms/app/helpers/user_helper.rb' -> `app/helpers/user_helper.rb'
`../../code/pragforms/app/helpers/accolade_helper.rb' -> `app/helpers/accolade_helper.rb'
`../../code/pragforms/app/helpers/favorite_language.rb' -> `app/helpers/favorite_language.rb'
`../../code/pragforms/app/helpers/application_helper.rb' -> `app/helpers/application_helper.rb'
`../../code/pragforms/app/helpers/random_helper.rb' -> `app/helpers/random_helper.rb'
`../../code/pragforms/app/helpers/zip_helper.rb' -> `app/helpers/zip_helper.rb'
`../../code/pragforms/app/helpers/language_helper.rb' -> `app/helpers/language_helper.rb'
cp -v ../../code/pragforms/Rakefile .
`../../code/pragforms/Rakefile' -> `./Rakefile'
rake prag:create_users
(in /home/rubys/svn/RAILS3/Book/util/pragforms)
get /user/
Routing Error
No route matches "/user/" with {:method=>:get}
get /user/search_demo
Routing Error
No route matches "/user/search_demo" with {:method=>:get}
get /user/autocomplete_demo
Routing Error
No route matches "/user/autocomplete_demo" with {:method=>:get}
24.1 Sending E-mail
rails mailer
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
ln -s ~/git/rails vendor/rails
ruby script/generate mailer OrderMailer confirm sent
exists app/models/
create app/views/order_mailer
exists test/unit/
create test/fixtures/order_mailer
create app/models/order_mailer.rb
create test/unit/order_mailer_test.rb
create app/views/order_mailer/confirm.erb
create test/fixtures/order_mailer/confirm
create app/views/order_mailer/sent.erb
create test/fixtures/order_mailer/sent
cp -vr ../../code/e1/mailer/db/migrate db
`../../code/e1/mailer/db/migrate' -> `db/migrate'
`../../code/e1/mailer/db/migrate/.svn' -> `db/migrate/.svn'
`../../code/e1/mailer/db/migrate/.svn/text-base' -> `db/migrate/.svn/text-base'
`../../code/e1/mailer/db/migrate/.svn/text-base/003_create_orders.rb.svn-base' -> `db/migrate/.svn/text-base/003_create_orders.rb.svn-base'
`../../code/e1/mailer/db/migrate/.svn/text-base/001_create_products.rb.svn-base' -> `db/migrate/.svn/text-base/001_create_products.rb.svn-base'
`../../code/e1/mailer/db/migrate/.svn/text-base/004_populate_data.rb.svn-base' -> `db/migrate/.svn/text-base/004_populate_data.rb.svn-base'
`../../code/e1/mailer/db/migrate/.svn/text-base/002_create_line_items.rb.svn-base' -> `db/migrate/.svn/text-base/002_create_line_items.rb.svn-base'
`../../code/e1/mailer/db/migrate/.svn/entries' -> `db/migrate/.svn/entries'
`../../code/e1/mailer/db/migrate/.svn/props' -> `db/migrate/.svn/props'
`../../code/e1/mailer/db/migrate/.svn/tmp' -> `db/migrate/.svn/tmp'
`../../code/e1/mailer/db/migrate/.svn/tmp/text-base' -> `db/migrate/.svn/tmp/text-base'
`../../code/e1/mailer/db/migrate/.svn/tmp/props' -> `db/migrate/.svn/tmp/props'
`../../code/e1/mailer/db/migrate/.svn/tmp/prop-base' -> `db/migrate/.svn/tmp/prop-base'
`../../code/e1/mailer/db/migrate/.svn/all-wcprops' -> `db/migrate/.svn/all-wcprops'
`../../code/e1/mailer/db/migrate/.svn/format' -> `db/migrate/.svn/format'
`../../code/e1/mailer/db/migrate/.svn/prop-base' -> `db/migrate/.svn/prop-base'
`../../code/e1/mailer/db/migrate/002_create_line_items.rb' -> `db/migrate/002_create_line_items.rb'
`../../code/e1/mailer/db/migrate/004_populate_data.rb' -> `db/migrate/004_populate_data.rb'
`../../code/e1/mailer/db/migrate/003_create_orders.rb' -> `db/migrate/003_create_orders.rb'
`../../code/e1/mailer/db/migrate/001_create_products.rb' -> `db/migrate/001_create_products.rb'
cp -v ../../code/e1/mailer/app/controllers/* app/controllers
`../../code/e1/mailer/app/controllers/application.rb' -> `app/controllers/application.rb'
`../../code/e1/mailer/app/controllers/order_controller.rb' -> `app/controllers/order_controller.rb'
`../../code/e1/mailer/app/controllers/test_controller.rb' -> `app/controllers/test_controller.rb'
cp -v ../../code/e1/mailer/app/models/* app/models
`../../code/e1/mailer/app/models/incoming_ticket_handler.rb' -> `app/models/incoming_ticket_handler.rb'
`../../code/e1/mailer/app/models/line_item.rb' -> `app/models/line_item.rb'
`../../code/e1/mailer/app/models/order.rb' -> `app/models/order.rb'
`../../code/e1/mailer/app/models/order_mailer.rb' -> `app/models/order_mailer.rb'
`../../code/e1/mailer/app/models/product.rb' -> `app/models/product.rb'
cp -vr ../../code/e1/mailer/test .
`../../code/e1/mailer/test/.svn' -> `./test/.svn'
`../../code/e1/mailer/test/.svn/text-base' -> `./test/.svn/text-base'
`../../code/e1/mailer/test/.svn/text-base/test_helper.rb.svn-base' -> `./test/.svn/text-base/test_helper.rb.svn-base'
`../../code/e1/mailer/test/.svn/entries' -> `./test/.svn/entries'
`../../code/e1/mailer/test/.svn/props' -> `./test/.svn/props'
`../../code/e1/mailer/test/.svn/tmp' -> `./test/.svn/tmp'
`../../code/e1/mailer/test/.svn/tmp/text-base' -> `./test/.svn/tmp/text-base'
`../../code/e1/mailer/test/.svn/tmp/props' -> `./test/.svn/tmp/props'
`../../code/e1/mailer/test/.svn/tmp/prop-base' -> `./test/.svn/tmp/prop-base'
`../../code/e1/mailer/test/.svn/all-wcprops' -> `./test/.svn/all-wcprops'
`../../code/e1/mailer/test/.svn/format' -> `./test/.svn/format'
`../../code/e1/mailer/test/.svn/prop-base' -> `./test/.svn/prop-base'
`../../code/e1/mailer/test/fixtures/.svn' -> `./test/fixtures/.svn'
`../../code/e1/mailer/test/fixtures/.svn/text-base' -> `./test/fixtures/.svn/text-base'
`../../code/e1/mailer/test/fixtures/.svn/text-base/products.yml.svn-base' -> `./test/fixtures/.svn/text-base/products.yml.svn-base'
`../../code/e1/mailer/test/fixtures/.svn/text-base/line_items.yml.svn-base' -> `./test/fixtures/.svn/text-base/line_items.yml.svn-base'
`../../code/e1/mailer/test/fixtures/.svn/text-base/orders.yml.svn-base' -> `./test/fixtures/.svn/text-base/orders.yml.svn-base'
`../../code/e1/mailer/test/fixtures/.svn/entries' -> `./test/fixtures/.svn/entries'
`../../code/e1/mailer/test/fixtures/.svn/props' -> `./test/fixtures/.svn/props'
`../../code/e1/mailer/test/fixtures/.svn/tmp' -> `./test/fixtures/.svn/tmp'
`../../code/e1/mailer/test/fixtures/.svn/tmp/text-base' -> `./test/fixtures/.svn/tmp/text-base'
`../../code/e1/mailer/test/fixtures/.svn/tmp/props' -> `./test/fixtures/.svn/tmp/props'
`../../code/e1/mailer/test/fixtures/.svn/tmp/prop-base' -> `./test/fixtures/.svn/tmp/prop-base'
`../../code/e1/mailer/test/fixtures/.svn/all-wcprops' -> `./test/fixtures/.svn/all-wcprops'
`../../code/e1/mailer/test/fixtures/.svn/format' -> `./test/fixtures/.svn/format'
`../../code/e1/mailer/test/fixtures/.svn/prop-base' -> `./test/fixtures/.svn/prop-base'
`../../code/e1/mailer/test/fixtures/orders.yml' -> `./test/fixtures/orders.yml'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn' -> `./test/fixtures/order_mailer/.svn'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/text-base' -> `./test/fixtures/order_mailer/.svn/text-base'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/text-base/confirm.svn-base' -> `./test/fixtures/order_mailer/.svn/text-base/confirm.svn-base'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/text-base/sent.svn-base' -> `./test/fixtures/order_mailer/.svn/text-base/sent.svn-base'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/entries' -> `./test/fixtures/order_mailer/.svn/entries'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/props' -> `./test/fixtures/order_mailer/.svn/props'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/tmp' -> `./test/fixtures/order_mailer/.svn/tmp'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/tmp/text-base' -> `./test/fixtures/order_mailer/.svn/tmp/text-base'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/tmp/props' -> `./test/fixtures/order_mailer/.svn/tmp/props'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/tmp/prop-base' -> `./test/fixtures/order_mailer/.svn/tmp/prop-base'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/all-wcprops' -> `./test/fixtures/order_mailer/.svn/all-wcprops'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/format' -> `./test/fixtures/order_mailer/.svn/format'
`../../code/e1/mailer/test/fixtures/order_mailer/.svn/prop-base' -> `./test/fixtures/order_mailer/.svn/prop-base'
`../../code/e1/mailer/test/fixtures/order_mailer/sent' -> `./test/fixtures/order_mailer/sent'
`../../code/e1/mailer/test/fixtures/order_mailer/confirm' -> `./test/fixtures/order_mailer/confirm'
`../../code/e1/mailer/test/fixtures/line_items.yml' -> `./test/fixtures/line_items.yml'
`../../code/e1/mailer/test/fixtures/products.yml' -> `./test/fixtures/products.yml'
`../../code/e1/mailer/test/integration/.svn' -> `./test/integration/.svn'
`../../code/e1/mailer/test/integration/.svn/text-base' -> `./test/integration/.svn/text-base'
`../../code/e1/mailer/test/integration/.svn/entries' -> `./test/integration/.svn/entries'
`../../code/e1/mailer/test/integration/.svn/props' -> `./test/integration/.svn/props'
`../../code/e1/mailer/test/integration/.svn/tmp' -> `./test/integration/.svn/tmp'
`../../code/e1/mailer/test/integration/.svn/tmp/text-base' -> `./test/integration/.svn/tmp/text-base'
`../../code/e1/mailer/test/integration/.svn/tmp/props' -> `./test/integration/.svn/tmp/props'
`../../code/e1/mailer/test/integration/.svn/tmp/prop-base' -> `./test/integration/.svn/tmp/prop-base'
`../../code/e1/mailer/test/integration/.svn/all-wcprops' -> `./test/integration/.svn/all-wcprops'
`../../code/e1/mailer/test/integration/.svn/format' -> `./test/integration/.svn/format'
`../../code/e1/mailer/test/integration/.svn/prop-base' -> `./test/integration/.svn/prop-base'
`../../code/e1/mailer/test/test_helper.rb' -> `./test/test_helper.rb'
`../../code/e1/mailer/test/unit/.svn' -> `./test/unit/.svn'
`../../code/e1/mailer/test/unit/.svn/text-base' -> `./test/unit/.svn/text-base'
`../../code/e1/mailer/test/unit/.svn/text-base/order_mailer_test.rb.svn-base' -> `./test/unit/.svn/text-base/order_mailer_test.rb.svn-base'
`../../code/e1/mailer/test/unit/.svn/text-base/order_test.rb.svn-base' -> `./test/unit/.svn/text-base/order_test.rb.svn-base'
`../../code/e1/mailer/test/unit/.svn/text-base/product_test.rb.svn-base' -> `./test/unit/.svn/text-base/product_test.rb.svn-base'
`../../code/e1/mailer/test/unit/.svn/text-base/line_item_test.rb.svn-base' -> `./test/unit/.svn/text-base/line_item_test.rb.svn-base'
`../../code/e1/mailer/test/unit/.svn/entries' -> `./test/unit/.svn/entries'
`../../code/e1/mailer/test/unit/.svn/props' -> `./test/unit/.svn/props'
`../../code/e1/mailer/test/unit/.svn/tmp' -> `./test/unit/.svn/tmp'
`../../code/e1/mailer/test/unit/.svn/tmp/text-base' -> `./test/unit/.svn/tmp/text-base'
`../../code/e1/mailer/test/unit/.svn/tmp/props' -> `./test/unit/.svn/tmp/props'
`../../code/e1/mailer/test/unit/.svn/tmp/prop-base' -> `./test/unit/.svn/tmp/prop-base'
`../../code/e1/mailer/test/unit/.svn/all-wcprops' -> `./test/unit/.svn/all-wcprops'
`../../code/e1/mailer/test/unit/.svn/format' -> `./test/unit/.svn/format'
`../../code/e1/mailer/test/unit/.svn/prop-base' -> `./test/unit/.svn/prop-base'
`../../code/e1/mailer/test/unit/order_test.rb' -> `./test/unit/order_test.rb'
`../../code/e1/mailer/test/unit/order_mailer_test.rb' -> `./test/unit/order_mailer_test.rb'
`../../code/e1/mailer/test/unit/product_test.rb' -> `./test/unit/product_test.rb'
`../../code/e1/mailer/test/unit/line_item_test.rb' -> `./test/unit/line_item_test.rb'
`../../code/e1/mailer/test/functional/.svn' -> `./test/functional/.svn'
`../../code/e1/mailer/test/functional/.svn/text-base' -> `./test/functional/.svn/text-base'
`../../code/e1/mailer/test/functional/.svn/text-base/order_controller_test.rb.svn-base' -> `./test/functional/.svn/text-base/order_controller_test.rb.svn-base'
`../../code/e1/mailer/test/functional/.svn/entries' -> `./test/functional/.svn/entries'
`../../code/e1/mailer/test/functional/.svn/props' -> `./test/functional/.svn/props'
`../../code/e1/mailer/test/functional/.svn/tmp' -> `./test/functional/.svn/tmp'
`../../code/e1/mailer/test/functional/.svn/tmp/text-base' -> `./test/functional/.svn/tmp/text-base'
`../../code/e1/mailer/test/functional/.svn/tmp/props' -> `./test/functional/.svn/tmp/props'
`../../code/e1/mailer/test/functional/.svn/tmp/prop-base' -> `./test/functional/.svn/tmp/prop-base'
`../../code/e1/mailer/test/functional/.svn/all-wcprops' -> `./test/functional/.svn/all-wcprops'
`../../code/e1/mailer/test/functional/.svn/format' -> `./test/functional/.svn/format'
`../../code/e1/mailer/test/functional/.svn/prop-base' -> `./test/functional/.svn/prop-base'
`../../code/e1/mailer/test/functional/order_controller_test.rb' -> `./test/functional/order_controller_test.rb'
cp -vr ../../code/e1/mailer/app/views/order_mailer app/views
`../../code/e1/mailer/app/views/order_mailer/.svn' -> `app/views/order_mailer/.svn'
`../../code/e1/mailer/app/views/order_mailer/.svn/text-base' -> `app/views/order_mailer/.svn/text-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/text-base/_html_line_item.erb.svn-base' -> `app/views/order_mailer/.svn/text-base/_html_line_item.erb.svn-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/text-base/survey.text.html.erb.svn-base' -> `app/views/order_mailer/.svn/text-base/survey.text.html.erb.svn-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/text-base/_line_item.erb.svn-base' -> `app/views/order_mailer/.svn/text-base/_line_item.erb.svn-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/text-base/sent.erb.svn-base' -> `app/views/order_mailer/.svn/text-base/sent.erb.svn-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/text-base/confirm.erb.svn-base' -> `app/views/order_mailer/.svn/text-base/confirm.erb.svn-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/text-base/survey.text.plain.erb.svn-base' -> `app/views/order_mailer/.svn/text-base/survey.text.plain.erb.svn-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/entries' -> `app/views/order_mailer/.svn/entries'
`../../code/e1/mailer/app/views/order_mailer/.svn/props' -> `app/views/order_mailer/.svn/props'
`../../code/e1/mailer/app/views/order_mailer/.svn/tmp' -> `app/views/order_mailer/.svn/tmp'
`../../code/e1/mailer/app/views/order_mailer/.svn/tmp/text-base' -> `app/views/order_mailer/.svn/tmp/text-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/tmp/props' -> `app/views/order_mailer/.svn/tmp/props'
`../../code/e1/mailer/app/views/order_mailer/.svn/tmp/prop-base' -> `app/views/order_mailer/.svn/tmp/prop-base'
`../../code/e1/mailer/app/views/order_mailer/.svn/all-wcprops' -> `app/views/order_mailer/.svn/all-wcprops'
`../../code/e1/mailer/app/views/order_mailer/.svn/format' -> `app/views/order_mailer/.svn/format'
`../../code/e1/mailer/app/views/order_mailer/.svn/prop-base' -> `app/views/order_mailer/.svn/prop-base'
`../../code/e1/mailer/app/views/order_mailer/_html_line_item.erb' -> `app/views/order_mailer/_html_line_item.erb'
`../../code/e1/mailer/app/views/order_mailer/survey.text.plain.erb' -> `app/views/order_mailer/survey.text.plain.erb'
`../../code/e1/mailer/app/views/order_mailer/_line_item.erb' -> `app/views/order_mailer/_line_item.erb'
`../../code/e1/mailer/app/views/order_mailer/confirm.erb' -> `app/views/order_mailer/confirm.erb'
`../../code/e1/mailer/app/views/order_mailer/survey.text.html.erb' -> `app/views/order_mailer/survey.text.html.erb'
`../../code/e1/mailer/app/views/order_mailer/sent.erb' -> `app/views/order_mailer/sent.erb'
restart
rake db:migrate
mv 002_create_line_items.rb 20080601000001_create_line_items.rb
mv 004_populate_data.rb 20080601000002_populate_data.rb
mv 003_create_orders.rb 20080601000003_create_orders.rb
mv 001_create_products.rb 20080601000004_create_products.rb
rake aborted!
An error has occurred, all later migrations canceled:
Could not find table 'products'
(See full trace by running task with --trace)
(in /home/rubys/svn/RAILS3/Book/util/mailer)
== CreateLineItems: migrating ================================================
-- create_table(:line_items)
-> 0.0093s
== CreateLineItems: migrated (0.0095s) =======================================
== PopulateData: migrating ===================================================
get /test/create_order
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
ActiveRecord::StatementInvalid
in TestController#create_order
</h1>
<pre>Could not find table 'orders'</pre>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/mailer</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:39:in `returning'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:194:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1279:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1292:in `column_names'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `column_methods_hash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1849:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/mailer/app/controllers/test_controller.rb:6:in `create_order'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:39:in `returning'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:194:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1279:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1292:in `column_names'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `column_methods_hash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1849:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/mailer/app/controllers/test_controller.rb:6:in `create_order'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:39:in `returning'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:194:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1279:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1292:in `column_names'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `column_methods_hash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1849:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/mailer/app/controllers/test_controller.rb:6:in `create_order'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:1875:in `framework'
makedepot.rb:2331
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
get /test/ship_order
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
ActiveRecord::StatementInvalid
in TestController#ship_order
</h1>
<pre>Could not find table 'orders'</pre>
<p><code>RAILS_ROOT: /home/rubys/svn/RAILS3/Book/util/mailer</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Application-Trace').style.display='block';; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Full-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='block';; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById('Application-Trace').style.display='none';document.getElementById('Framework-Trace').style.display='none';document.getElementById('Full-Trace').style.display='block';; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:39:in `returning'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:194:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1279:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1292:in `column_names'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `column_methods_hash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1849:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/mailer/app/controllers/test_controller.rb:14:in `ship_order'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'</code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:39:in `returning'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:194:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1279:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1292:in `column_names'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `column_methods_hash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1849:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/mailer/app/controllers/test_controller.rb:14:in `ship_order'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:39:in `returning'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:194:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1279:in `columns'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1292:in `column_names'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1305:in `column_methods_hash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1993:in `all_attributes_exists?'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/base.rb:1849:in `method_missing'
/home/rubys/svn/RAILS3/Book/util/mailer/app/controllers/test_controller.rb:14:in `ship_order'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:1322:in `perform_action_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/flash.rb:141:in `perform_action'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `send'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:523:in `process_without_filters'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:433:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:88:in `dispatch'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:111:in `_call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:82:in `initialize'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/rails/rack/static.rb:27:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:42:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `each'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:36:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:40:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:12:in `run'
/home/rubys/svn/RAILS3/Book/util/mailer/vendor/rails/railties/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
makedepot.rb:2270:in `restart_server'
makedepot.rb:1875:in `framework'
makedepot.rb:2331
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2302
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `call'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:134:in `_nested_structures'
/usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in `method_missing'
makedepot.rb:2275</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>None</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre class='debug_dump'>---
</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}</pre></p>
</body>
</html>
rake test
Run "rake db:migrate" to update your database then try again.
(in /home/rubys/svn/RAILS3/Book/util/mailer)
You have 3 pending migrations:
20080601000002 PopulateData
20080601000003 CreateOrders
20080601000004 CreateProducts
restart