Agile Web Development with Rails, Edition 4
25.1 rack
21.2 Form Helpers
24.3 Active Resources
Expected at least 1 element matching ".price", found 0.
Traceback:
/home/rubys/git/awdwr/edition4/checkdepot.rb:448:in `block in <class:DepotTest>'
Restart the server.
bundle exec /home/rubys/git/rails/bin/rails new depot_client --skip-bundle
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create log
create log/server.log
create log/production.log
create log/development.log
create log/test.log
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create public/images
create public/images/rails.png
create public/stylesheets
create public/stylesheets/.gitkeep
create public/javascripts
create public/javascripts/application.js
create public/javascripts/controls.js
create public/javascripts/dragdrop.js
create public/javascripts/effects.js
create public/javascripts/prototype.js
create public/javascripts/rails.js
create script
create script/rails
create test
create test/fixtures
create test/functional
create test/integration
create test/performance/browsing_test.rb
create test/test_helper.rb
create test/unit
create tmp
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create vendor/plugins
create vendor/plugins/.gitkeep
bundle install --local
Resolving dependencies...
Using rake (10.1.1)
Using abstract (1.0.0)
Using activesupport (3.0.20) from source at /home/rubys/git/rails
Using builder (2.1.2)
Using i18n (0.5.3)
Using activemodel (3.0.20) from source at /home/rubys/git/rails
Using erubis (2.6.6)
Using rack (1.2.8)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.38)
Using actionpack (3.0.20) from source at /home/rubys/git/rails
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.2.20)
Using actionmailer (3.0.20) from source at /home/rubys/git/rails
Using arel (2.0.10)
Using activerecord (3.0.20) from source at /home/rubys/git/rails
Using activeresource (3.0.20) from source at /home/rubys/git/rails
Using bundler (1.5.2)
Using json (1.8.1)
Using rdoc (3.12.2)
Using thor (0.14.6)
Using railties (3.0.20) from source at /home/rubys/git/rails
Using rails (3.0.20) from source at /home/rubys/git/rails
Using sqlite3 (1.3.8)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
edit app/models/product.rb
class Product < ActiveResource::Base
self.site = 'http://dave:secret@localhost:3000/'
end
echo "Product.find(2).title" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.20)
Switch to inspect mode.
>> Product.find(2).title
=> "CoffeeScript"
>>
edit app/controllers/line_items_controller.rb
def create
if params[:line_item]
# ActiveResource
params[:line_item][:order_id] = params[:order_id]
@line_item = LineItem.new(params[:line_item])
else
# HTML forms
product = Product.find(params[:product_id])
@line_item = @cart.add_product(product.id)
end
@line_item.product = product
respond_to do |format|
if @line_item.save
format.html { redirect_to(store_url) }
format.js { @current_item = @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
Depot::Application.routes.draw do
get 'admin' => 'admin#index'
controller :sessions do
get 'login' => :new
post 'login' => :create
delete 'logout' => :destroy
end
resources :users
resources :products do
get :who_bought, on: :member
end
scope '(:locale)' do
resources :orders do
resources :line_items
end
resources :line_items
resources :carts
root to: "store#index", as: 'store'
end
end
echo "Product.find(2).title" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.20)
Switch to inspect mode.
>> Product.find(2).title
=> "CoffeeScript"
>>
echo "p = Product.find(2)\\nputs p.price\\np.price -= 5\\np.save" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.20)
Switch to inspect mode.
>> p = Product.find(2)
=> #<Product:0x00000002c1adc0 @attributes={"created_at"=>2014-02-04 20:40:52 UTC, "description"=>"<p>\n CoffeeScript is JavaScript done right. It provides all of JavaScript's\n\tfunctionality wrapped in a cleaner, more succinct syntax. In the first\n\tbook on this exciting new language, CoffeeScript guru Trevor Burnham\n\tshows you how to hold onto all the power and flexibility of JavaScript\n\twhile writing clearer, cleaner, and safer code.\n </p>", "id"=>2, "image_url"=>"/images/cs.jpg", "price"=>#<BigDecimal:2c1d1b0,'0.36E2',9(18)>, "title"=>"CoffeeScript", "updated_at"=>2014-02-04 20:40:52 UTC}, @prefix_options={}>
>> puts p.price
36.0
=> nil
>> p.price -= 5
=> #<BigDecimal:2be5508,'0.31E2',9(27)>
>> p.save
=> true
>>
expire cache
rm -rf /home/rubys/git/awdwr/edition4/work-192-30/depot/tmp/cache
fetch storefront
get /
NameError in
Store#index
Showing /home/rubys/git/awdwr/edition4/work-192-30/depot/app/views/store/index.html.erb where line #6 raised:
uninitialized constant I18n::RESERVED_KEYS
Extracted source (around line #6 ):
3: <% end %>
4:
5: <!-- START_HIGHLIGHT -->
6: <h1><%= t('.title_html') %></h1>
7: <!-- END_HIGHLIGHT -->
8:
9: <% @products.each do |product| %>
Rails.root: /home/rubys/git/awdwr/edition4/work-192-30/depot
Application Trace |
Framework Trace |
Full Trace
app/views/store/index.html.erb:6:in `_app_views_store_index_html_erb___2964376750573579948_69908921373540_456367400050179959'
/home/rubys/git/rails/actionpack/lib/action_view/helpers/translation_helper.rb:50:in `translate'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `block in render'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:54:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:127:in `render'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:59:in `block in _render_template'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:56:in `_render_template'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:26:in `render'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:115:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:109:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:102:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:93:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:17:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
/home/rubys/git/rails/activerecord/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:39:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:446:in `_run__996417639357390307__process_action__487084524775328082__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `block in action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:257:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.8) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `block in call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.8) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.8) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.8) lib/rack/lock.rb:13:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.8) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.8) lib/rack/content_length.rb:13:in `call'
rack (1.2.8) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
/home/rubys/git/rails/actionpack/lib/action_view/helpers/translation_helper.rb:50:in `translate'
app/views/store/index.html.erb:6:in `_app_views_store_index_html_erb___2964376750573579948_69908921373540_456367400050179959'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `block in render'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:54:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:127:in `render'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:59:in `block in _render_template'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:56:in `_render_template'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:26:in `render'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:115:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:109:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:102:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:93:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:17:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
/home/rubys/git/rails/activerecord/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:39:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:446:in `_run__996417639357390307__process_action__487084524775328082__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `block in action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:257:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.8) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `block in call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.8) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.8) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.8) lib/rack/lock.rb:13:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.8) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.8) lib/rack/content_length.rb:13:in `call'
rack (1.2.8) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Request
Parameters :
None
Show session dump
cart_id: 8
session_id: "18e96d18a5b0a24d50e62c05b0bce85d"
Show env dump
GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html"
HTTP_COOKIE: "_views_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY%3D--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7; path=/; HttpOnly"
HTTP_HOST: "localhost:3000"
HTTP_USER_AGENT: "Ruby"
HTTP_VERSION: "HTTP/1.1"
PATH_INFO: "/"
QUERY_STRING: ""
REMOTE_ADDR: "127.0.0.1"
REMOTE_HOST: "localhost"
REQUEST_METHOD: "GET"
REQUEST_PATH: "/"
REQUEST_URI: "http://localhost:3000/"
SCRIPT_NAME: ""
SERVER_NAME: "localhost"
SERVER_PORT: "3000"
SERVER_PROTOCOL: "HTTP/1.1"
SERVER_SOFTWARE: "WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)"
action_controller.instance: #<StoreController:0x007f29e109b8b8 @action_has_layout=true, @view_context_class=nil, @_headers={"Content-Type"=>"text/html"}, @_status=200, @_response=#<ActionDispatch::Response:0x007f29e109b728 @writer=#<Proc:0x007f29e109b660@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43 (lambda)>, @block=nil, @length=0, @header={}, @status=200, @body=[], @cookie=[], @sending_file=false, @blank=false, @cache_control={}, @etag=nil, @request=#<ActionDispatch::Request:0x007f29e109b750 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"http://localhost:3000/", "SCRIPT_NAME"=>"", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"3000", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_views_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY%3D--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x007f29e0215370>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"c51086661c17b125348d82415b3c706b138e238eedbbf99205f8e2cf2ed6f59da3ea58c8b419d3431e9c4996b946c1deab67d42de2ad0913bc14864aceed4017", "action_dispatch.show_exceptions"=>true, "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"session_id"=>"18e96d18a5b0a24d50e62c05b0bce85d", "cart_id"=>8}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"18e96d18a5b0a24d50e62c05b0bce85d"}, "rack.request.cookie_string"=>"_views_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY%3D--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_views_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY=--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.cookies"=>{"_views_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY=--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.request.unsigned_session_cookie"=>{"session_id"=>"18e96d18a5b0a24d50e62c05b0bce85d"}, "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"index"}, "action_controller.instance"=>#<StoreController:0x007f29e109b8b8 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"store", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{}}, @request_method="GET", @filtered_parameters={"controller"=>"store", "action"=>"index"}, @method="GET", @fullpath="/">>, @_request=#<ActionDispatch::Request:0x007f29e109b750 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"http://localhost:3000/", "SCRIPT_NAME"=>"", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"3000", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_views_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY%3D--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x007f29e0215370>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"c51086661c17b125348d82415b3c706b138e238eedbbf99205f8e2cf2ed6f59da3ea58c8b419d3431e9c4996b946c1deab67d42de2ad0913bc14864aceed4017", "action_dispatch.show_exceptions"=>true, "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"session_id"=>"18e96d18a5b0a24d50e62c05b0bce85d", "cart_id"=>8}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"18e96d18a5b0a24d50e62c05b0bce85d"}, "rack.request.cookie_string"=>"_views_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY%3D--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_views_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY=--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.cookies"=>{"_views_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY=--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.request.unsigned_session_cookie"=>{"session_id"=>"18e96d18a5b0a24d50e62c05b0bce85d"}, "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"index"}, "action_controller.instance"=>#<StoreController:0x007f29e109b8b8 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"store", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{}}, @request_method="GET", @filtered_parameters={"controller"=>"store", "action"=>"index"}, @method="GET", @fullpath="/">, @_env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"http://localhost:3000/", "SCRIPT_NAME"=>"", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"3000", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_views_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY%3D--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x007f29e0215370>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"c51086661c17b125348d82415b3c706b138e238eedbbf99205f8e2cf2ed6f59da3ea58c8b419d3431e9c4996b946c1deab67d42de2ad0913bc14864aceed4017", "action_dispatch.show_exceptions"=>true, "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"session_id"=>"18e96d18a5b0a24d50e62c05b0bce85d", "cart_id"=>8}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"18e96d18a5b0a24d50e62c05b0bce85d"}, "rack.request.cookie_string"=>"_views_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY%3D--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_views_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY=--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.cookies"=>{"_views_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY=--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.request.unsigned_session_cookie"=>{"session_id"=>"18e96d18a5b0a24d50e62c05b0bce85d"}, "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"index"}, "action_controller.instance"=>#<StoreController:0x007f29e109b8b8 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"store", "action"=>"index"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{}}, @lookup_context=#<ActionView::LookupContext:0x007f29e1093a50 @details_key=#<ActionView::LookupContext::DetailsKey:0x007f29e03f2990 @hash=3564876543609209391>, @details={:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]}, @skip_default_locale=false, @frozen_formats=true, @view_paths=[/home/rubys/git/awdwr/edition4/work-192-30/depot/app/views]>, @_action_name="index", @_response_body=nil, @_config={}, @_params={"controller"=>"store", "action"=>"index"}, @cart=#<Cart id: 8, created_at: "2014-02-04 20:45:46", updated_at: "2014-02-04 20:45:46">, @products=[#<Product id: 2, title: "CoffeeScript", description: "<p>\n CoffeeScript is JavaScript done right. ...", image_url: "/images/cs.jpg", price: #<BigDecimal:7f29e07f7900,'0.31E2',9(18)>, created_at: "2014-02-04 20:40:52", updated_at: "2014-02-04 20:40:52">, #<Product id: 3, title: "Programming Ruby 1.9 & 2.0", description: "<p>\n Ruby is the fastest growing and most ex...", image_url: "/images/ruby.jpg", price: #<BigDecimal:7f29e07f5e48,'0.4995E2',18(18)>, created_at: "2014-02-04 20:40:52", updated_at: "2014-02-04 20:40:52">, #<Product id: 4, title: "Rails Test Prescriptions", description: "<p>\n <em>Rails Test Prescriptions</em> is a ...", image_url: "/images/rtp.jpg", price: #<BigDecimal:7f29e07f3328,'0.3495E2',18(18)>, created_at: "2014-02-04 20:40:52", updated_at: "2014-02-04 20:40:52">]>
action_dispatch.cookies: {"_views_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY=--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7", "path"=>"/", "HttpOnly"=>nil}
action_dispatch.parameter_filter: [:password]
action_dispatch.remote_ip: 127.0.0.1
action_dispatch.request.accepts: [text/html]
action_dispatch.request.content_type: nil
action_dispatch.request.flash_hash: {}
action_dispatch.request.formats: [text/html]
action_dispatch.request.parameters: {"controller"=>"store", "action"=>"index"}
action_dispatch.request.path_parameters: {:controller=>"store", :action=>"index"}
action_dispatch.request.query_parameters: {}
action_dispatch.request.request_parameters: {}
action_dispatch.request.unsigned_session_cookie: {"session_id"=>"18e96d18a5b0a24d50e62c05b0bce85d"}
action_dispatch.secret_token: "c51086661c17b125348d82415b3c706b138e238eedbbf99205f8e2cf2ed6f59da3ea58c8b419d3431e9c4996b946c1deab67d42de2ad0913bc14864aceed4017"
action_dispatch.show_exceptions: true
rack.errors: #<IO:<STDERR>>
rack.input: #<StringIO:0x007f29e0215370>
rack.multiprocess: false
rack.multithread: false
rack.request.cookie_hash: {"_views_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY=--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7", "path"=>"/", "HttpOnly"=>nil}
rack.request.cookie_string: "_views_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlOTNmZGE3NGJkYTRiYWYyY2UyZmQ1YTM0OWE5ZjY0OGFJIhBfY3NyZl90b2tlbgY7AEZJIjFEY1ZaazQyUDlmVkMyWFdGQ1o3Q2NyMExCVVhXSGdubHc3Rlo4bWdlQkNjPQY7AEY%3D--cf16dd2d6b4bb1e83676204b0195a4965bcc57e7; path=/; HttpOnly"
rack.request.query_hash: {}
rack.request.query_string: ""
rack.run_once: false
rack.session: {"session_id"=>"18e96d18a5b0a24d50e62c05b0bce85d", "cart_id"=>8}
rack.session.options: {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"18e96d18a5b0a24d50e62c05b0bce85d"}
rack.url_scheme: "http"
rack.version: [1, 1]
Response
Headers :
None
fetch product (fallback in case storefront is cached)
get /login
Pragmatic Bookshelf
post /login?locale=en
name => dave
password => secret
You are being
redirected .
get http://localhost:3000/admin?locale=en
Pragmatic Bookshelf
Welcome
It's 2014-02-04 15:45:47 -0500
We have 1 order.
get /products/2
Pragmatic Bookshelf
Title:
CoffeeScript
Description:
<p>
CoffeeScript is JavaScript done right. It provides all of JavaScript's
functionality wrapped in a cleaner, more succinct syntax. In the first
book on this exciting new language, CoffeeScript guru Trevor Burnham
shows you how to hold onto all the power and flexibility of JavaScript
while writing clearer, cleaner, and safer code.
</p>
Image url:
/images/cs.jpg
Price:
31.0
Edit |
Back
edit app/models/order.rb
class Order < ActiveResource::Base
self.site = 'http://dave:secret@localhost:3000/'
end
echo "Order.find(1).name\\nOrder.find(1).line_items\\n" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.20)
Switch to inspect mode.
>> Order.find(1).name
=> "Dave Thomas"
>> Order.find(1).line_items
NoMethodError: undefined method `line_items' for #<Order:0x0000000269eb08>
from /home/rubys/git/rails/activeresource/lib/active_resource/base.rb:1401:in `method_missing'
from (irb):2
from /home/rubys/git/rails/railties/lib/rails/commands/console.rb:44:in `start'
from /home/rubys/git/rails/railties/lib/rails/commands/console.rb:8:in `start'
from /home/rubys/git/rails/railties/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
>>
edit app/models/line_item.rb
class LineItem < ActiveResource::Base
self.site = 'http://dave:secret@localhost:3000/orders/:order_id'
end
post /logout?locale=en
You are being
redirected .
get http://localhost:3000/en
NameError in
Store#index
Showing /home/rubys/git/awdwr/edition4/work-192-30/depot/app/views/store/index.html.erb where line #6 raised:
uninitialized constant I18n::RESERVED_KEYS
Extracted source (around line #6 ):
3: <% end %>
4:
5: <!-- START_HIGHLIGHT -->
6: <h1><%= t('.title_html') %></h1>
7: <!-- END_HIGHLIGHT -->
8:
9: <% @products.each do |product| %>
Rails.root: /home/rubys/git/awdwr/edition4/work-192-30/depot
Application Trace |
Framework Trace |
Full Trace
app/views/store/index.html.erb:6:in `_app_views_store_index_html_erb___2964376750573579948_19378500_456367400050179959'
/home/rubys/git/rails/actionpack/lib/action_view/helpers/translation_helper.rb:50:in `translate'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `block in render'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:54:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:127:in `render'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:59:in `block in _render_template'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:56:in `_render_template'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:26:in `render'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:115:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:109:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:102:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:93:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:17:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
/home/rubys/git/rails/activerecord/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:39:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:446:in `_run__996417639357390307__process_action__487084524775328082__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `block in action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:257:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.8) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `block in call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.8) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.8) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.8) lib/rack/lock.rb:13:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.8) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.8) lib/rack/content_length.rb:13:in `call'
rack (1.2.8) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
/home/rubys/git/rails/actionpack/lib/action_view/helpers/translation_helper.rb:50:in `translate'
app/views/store/index.html.erb:6:in `_app_views_store_index_html_erb___2964376750573579948_19378500_456367400050179959'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:135:in `block in render'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:54:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/template.rb:127:in `render'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:59:in `block in _render_template'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:56:in `_render_template'
/home/rubys/git/rails/actionpack/lib/action_view/render/rendering.rb:26:in `render'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:115:in `_render_template'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:109:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:102:in `render_to_string'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:93:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:17:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/benchmark.rb:310:in `realtime'
/home/rubys/git/rails/activesupport/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
/home/rubys/git/rails/activerecord/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:39:in `render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:150:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:446:in `_run__996417639357390307__process_action__487084524775328082__callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:94:in `run_callbacks'
/home/rubys/git/rails/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `block in instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/rubys/git/rails/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/home/rubys/git/rails/actionpack/lib/abstract_controller/base.rb:119:in `process'
/home/rubys/git/rails/actionpack/lib/abstract_controller/rendering.rb:41:in `process'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:138:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_controller/metal.rb:178:in `block in action'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:33:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:257:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:499:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.8) lib/rack/methodoverride.rb:24:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:32:in `block in call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:12:in `cache'
/home/rubys/git/rails/activerecord/lib/active_record/query_cache.rb:31:in `call'
/home/rubys/git/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/rubys/git/rails/activesupport/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.8) lib/rack/sendfile.rb:106:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/rubys/git/rails/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.8) lib/rack/runtime.rb:17:in `call'
/home/rubys/git/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.8) lib/rack/lock.rb:13:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.8) lib/rack/lock.rb:13:in `call'
/home/rubys/git/rails/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:168:in `call'
/home/rubys/git/rails/railties/lib/rails/application.rb:77:in `method_missing'
/home/rubys/git/rails/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.8) lib/rack/content_length.rb:13:in `call'
rack (1.2.8) lib/rack/handler/webrick.rb:52:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rubys/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Request
Parameters :
{"locale"=>"en"}
Show session dump
_csrf_token: "BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY="
cart_id: 9
flash: {:notice=>"Logged out"}
session_id: "05083b84151244b3ac026c159a81d1fc"
Show env dump
GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html"
HTTP_COOKIE: "_depot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--793cdf458f72ee5b838f2613c906cdadf5b9dfac; path=/; HttpOnly"
HTTP_HOST: "localhost:3000"
HTTP_USER_AGENT: "Ruby"
HTTP_VERSION: "HTTP/1.1"
PATH_INFO: "/en"
QUERY_STRING: ""
REMOTE_ADDR: "127.0.0.1"
REMOTE_HOST: "localhost"
REQUEST_METHOD: "GET"
REQUEST_PATH: "/"
REQUEST_URI: "http://localhost:3000/en"
SCRIPT_NAME: ""
SERVER_NAME: "localhost"
SERVER_PORT: "3000"
SERVER_PROTOCOL: "HTTP/1.1"
SERVER_SOFTWARE: "WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)"
action_controller.instance: #<StoreController:0x007f29e08c39d8 @action_has_layout=true, @view_context_class=nil, @_headers={"Content-Type"=>"text/html"}, @_status=200, @_response=#<ActionDispatch::Response:0x007f29e08c35f0 @writer=#<Proc:0x007f29e08c3320@/home/rubys/git/rails/actionpack/lib/action_dispatch/http/response.rb:43 (lambda)>, @block=nil, @length=0, @header={}, @status=200, @body=[], @cookie=[], @sending_file=false, @blank=false, @cache_control={}, @etag=nil, @request=#<ActionDispatch::Request:0x007f29e08c3618 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/en", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"http://localhost:3000/en", "SCRIPT_NAME"=>"", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"3000", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_depot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--793cdf458f72ee5b838f2613c906cdadf5b9dfac; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x007f29e0ceeb98>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"c51086661c17b125348d82415b3c706b138e238eedbbf99205f8e2cf2ed6f59da3ea58c8b419d3431e9c4996b946c1deab67d42de2ad0913bc14864aceed4017", "action_dispatch.show_exceptions"=>true, "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"session_id"=>"05083b84151244b3ac026c159a81d1fc", "_csrf_token"=>"BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY=", "flash"=>{:notice=>"Logged out"}, "cart_id"=>9}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"05083b84151244b3ac026c159a81d1fc"}, "rack.request.cookie_string"=>"_depot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--793cdf458f72ee5b838f2613c906cdadf5b9dfac; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_depot_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA=--793cdf458f72ee5b838f2613c906cdadf5b9dfac", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.cookies"=>{"_depot_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA=--793cdf458f72ee5b838f2613c906cdadf5b9dfac", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.request.unsigned_session_cookie"=>{"session_id"=>"05083b84151244b3ac026c159a81d1fc", "_csrf_token"=>"BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY=", "flash"=>{:notice=>"Logged out"}}, "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"index", :locale=>"en"}, "action_controller.instance"=>#<StoreController:0x007f29e08c39d8 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"store", "action"=>"index", "locale"=>"en"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{:notice=>"Logged out"}}, @request_method="GET", @filtered_parameters={"controller"=>"store", "action"=>"index", "locale"=>"en"}, @method="GET", @fullpath="/en">>, @_request=#<ActionDispatch::Request:0x007f29e08c3618 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/en", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"http://localhost:3000/en", "SCRIPT_NAME"=>"", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"3000", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_depot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--793cdf458f72ee5b838f2613c906cdadf5b9dfac; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x007f29e0ceeb98>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"c51086661c17b125348d82415b3c706b138e238eedbbf99205f8e2cf2ed6f59da3ea58c8b419d3431e9c4996b946c1deab67d42de2ad0913bc14864aceed4017", "action_dispatch.show_exceptions"=>true, "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"session_id"=>"05083b84151244b3ac026c159a81d1fc", "_csrf_token"=>"BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY=", "flash"=>{:notice=>"Logged out"}, "cart_id"=>9}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"05083b84151244b3ac026c159a81d1fc"}, "rack.request.cookie_string"=>"_depot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--793cdf458f72ee5b838f2613c906cdadf5b9dfac; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_depot_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA=--793cdf458f72ee5b838f2613c906cdadf5b9dfac", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.cookies"=>{"_depot_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA=--793cdf458f72ee5b838f2613c906cdadf5b9dfac", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.request.unsigned_session_cookie"=>{"session_id"=>"05083b84151244b3ac026c159a81d1fc", "_csrf_token"=>"BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY=", "flash"=>{:notice=>"Logged out"}}, "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"index", :locale=>"en"}, "action_controller.instance"=>#<StoreController:0x007f29e08c39d8 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"store", "action"=>"index", "locale"=>"en"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{:notice=>"Logged out"}}, @request_method="GET", @filtered_parameters={"controller"=>"store", "action"=>"index", "locale"=>"en"}, @method="GET", @fullpath="/en">, @_env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/en", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"http://localhost:3000/en", "SCRIPT_NAME"=>"", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"3000", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)", "HTTP_ACCEPT"=>"text/html", "HTTP_USER_AGENT"=>"Ruby", "HTTP_COOKIE"=>"_depot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--793cdf458f72ee5b838f2613c906cdadf5b9dfac; path=/; HttpOnly", "HTTP_HOST"=>"localhost:3000", "rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x007f29e0ceeb98>, "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/", "action_dispatch.parameter_filter"=>[:password], "action_dispatch.secret_token"=>"c51086661c17b125348d82415b3c706b138e238eedbbf99205f8e2cf2ed6f59da3ea58c8b419d3431e9c4996b946c1deab67d42de2ad0913bc14864aceed4017", "action_dispatch.show_exceptions"=>true, "action_dispatch.remote_ip"=>127.0.0.1, "rack.session"=>{"session_id"=>"05083b84151244b3ac026c159a81d1fc", "_csrf_token"=>"BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY=", "flash"=>{:notice=>"Logged out"}, "cart_id"=>9}, "rack.session.options"=>{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"05083b84151244b3ac026c159a81d1fc"}, "rack.request.cookie_string"=>"_depot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--793cdf458f72ee5b838f2613c906cdadf5b9dfac; path=/; HttpOnly", "rack.request.cookie_hash"=>{"_depot_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA=--793cdf458f72ee5b838f2613c906cdadf5b9dfac", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.cookies"=>{"_depot_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA=--793cdf458f72ee5b838f2613c906cdadf5b9dfac", "path"=>"/", "HttpOnly"=>nil}, "action_dispatch.request.unsigned_session_cookie"=>{"session_id"=>"05083b84151244b3ac026c159a81d1fc", "_csrf_token"=>"BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY=", "flash"=>{:notice=>"Logged out"}}, "action_dispatch.request.path_parameters"=>{:controller=>"store", :action=>"index", :locale=>"en"}, "action_controller.instance"=>#<StoreController:0x007f29e08c39d8 ...>, "action_dispatch.request.content_type"=>nil, "action_dispatch.request.request_parameters"=>{}, "rack.request.query_string"=>"", "rack.request.query_hash"=>{}, "action_dispatch.request.query_parameters"=>{}, "action_dispatch.request.parameters"=>{"controller"=>"store", "action"=>"index", "locale"=>"en"}, "action_dispatch.request.accepts"=>[text/html], "action_dispatch.request.formats"=>[text/html], "action_dispatch.request.flash_hash"=>{:notice=>"Logged out"}}, @lookup_context=#<ActionView::LookupContext:0x007f29e08b38a8 @details_key=#<ActionView::LookupContext::DetailsKey:0x007f29e03f2990 @hash=3564876543609209391>, @details={:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]}, @skip_default_locale=false, @frozen_formats=true, @view_paths=[/home/rubys/git/awdwr/edition4/work-192-30/depot/app/views]>, @_action_name="index", @_response_body=nil, @_config={}, @_params={"controller"=>"store", "action"=>"index", "locale"=>"en"}, @cart=#<Cart id: 9, created_at: "2014-02-04 20:45:49", updated_at: "2014-02-04 20:45:49">, @products=[#<Product id: 2, title: "CoffeeScript", description: "<p>\n CoffeeScript is JavaScript done right. ...", image_url: "/images/cs.jpg", price: #<BigDecimal:7f29e13570e8,'0.31E2',9(18)>, created_at: "2014-02-04 20:40:52", updated_at: "2014-02-04 20:40:52">, #<Product id: 3, title: "Programming Ruby 1.9 & 2.0", description: "<p>\n Ruby is the fastest growing and most ex...", image_url: "/images/ruby.jpg", price: #<BigDecimal:7f29e135dc40,'0.4995E2',18(18)>, created_at: "2014-02-04 20:40:52", updated_at: "2014-02-04 20:40:52">, #<Product id: 4, title: "Rails Test Prescriptions", description: "<p>\n <em>Rails Test Prescriptions</em> is a ...", image_url: "/images/rtp.jpg", price: #<BigDecimal:7f29e135c2f0,'0.3495E2',18(18)>, created_at: "2014-02-04 20:40:52", updated_at: "2014-02-04 20:40:52">]>
action_dispatch.cookies: {"_depot_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA=--793cdf458f72ee5b838f2613c906cdadf5b9dfac", "path"=>"/", "HttpOnly"=>nil}
action_dispatch.parameter_filter: [:password]
action_dispatch.remote_ip: 127.0.0.1
action_dispatch.request.accepts: [text/html]
action_dispatch.request.content_type: nil
action_dispatch.request.flash_hash: {:notice=>"Logged out"}
action_dispatch.request.formats: [text/html]
action_dispatch.request.parameters: {"controller"=>"store", "action"=>"index", "locale"=>"en"}
action_dispatch.request.path_parameters: {:controller=>"store", :action=>"index", :locale=>"en"}
action_dispatch.request.query_parameters: {}
action_dispatch.request.request_parameters: {}
action_dispatch.request.unsigned_session_cookie: {"session_id"=>"05083b84151244b3ac026c159a81d1fc", "_csrf_token"=>"BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY=", "flash"=>{:notice=>"Logged out"}}
action_dispatch.secret_token: "c51086661c17b125348d82415b3c706b138e238eedbbf99205f8e2cf2ed6f59da3ea58c8b419d3431e9c4996b946c1deab67d42de2ad0913bc14864aceed4017"
action_dispatch.show_exceptions: true
rack.errors: #<IO:<STDERR>>
rack.input: #<StringIO:0x007f29e0ceeb98>
rack.multiprocess: false
rack.multithread: false
rack.request.cookie_hash: {"_depot_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA=--793cdf458f72ee5b838f2613c906cdadf5b9dfac", "path"=>"/", "HttpOnly"=>nil}
rack.request.cookie_string: "_depot_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiIlMDUwODNiODQxNTEyNDRiM2FjMDI2YzE1OWE4MWQxZmNJIhBfY3NyZl90b2tlbgY7AEZJIjFCZ2NNRDBOMUFITE1UeEhubFlCQlpFZVlRT0c5V3V5VDFZWU5aSGtRNEZZPQY7AEZJIgpmbGFzaAY7AEZJQzolQWN0aW9uRGlzcGF0Y2g6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlSSIPTG9nZ2VkIG91dAY7AEYGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--793cdf458f72ee5b838f2613c906cdadf5b9dfac; path=/; HttpOnly"
rack.request.query_hash: {}
rack.request.query_string: ""
rack.run_once: false
rack.session: {"session_id"=>"05083b84151244b3ac026c159a81d1fc", "_csrf_token"=>"BgcMD0N1AHLMTxHnlYBBZEeYQOG9WuyT1YYNZHkQ4FY=", "flash"=>{:notice=>"Logged out"}, "cart_id"=>9}
rack.session.options: {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :id=>"05083b84151244b3ac026c159a81d1fc"}
rack.url_scheme: "http"
rack.version: [1, 1]
Response
Headers :
None
echo "LineItem.find(:all, :params => {:order_id=>1})" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.20)
Switch to inspect mode.
>> LineItem.find(:all, :params => {:order_id=>1})
=> [#<LineItem:0x000000032769f8 @attributes={"cart_id"=>nil, "created_at"=>2014-02-04 20:42:40 UTC, "id"=>10, "price"=>#<BigDecimal:327bc00,'0.36E2',9(18)>, "product_id"=>2, "quantity"=>1, "updated_at"=>2014-02-04 20:42:56 UTC}, @prefix_options={:order_id=>1}>]
>>
echo "li = LineItem.find(:all, :params => {:order_id=>1}).first\\nputs li.price\\nli.price *= 0.8\\nli.save" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.20)
Switch to inspect mode.
>> li = LineItem.find(:all, :params => {:order_id=>1}).first
=> #<LineItem:0x0000000360b960 @attributes={"cart_id"=>nil, "created_at"=>2014-02-04 20:42:40 UTC, "id"=>10, "price"=>#<BigDecimal:364fc28,'0.36E2',9(18)>, "product_id"=>2, "quantity"=>1, "updated_at"=>2014-02-04 20:42:56 UTC}, @prefix_options={:order_id=>1}>
>> puts li.price
36.0
=> nil
>> li.price *= 0.8
=> 28.8
>> li.save
=> true
>>
get /orders/1/line_items.xml
<?xml version="1.0" encoding="UTF-8"?>
<line-items type="array">
<line-item>
<cart-id type="integer" nil="true"></cart-id>
<created-at type="datetime">2014-02-04T20:42:40Z</created-at>
<id type="integer">10</id>
<order-id type="integer">1</order-id>
<price type="decimal">28.8</price>
<product-id type="integer">2</product-id>
<quantity type="integer">1</quantity>
<updated-at type="datetime">2014-02-04T20:42:56Z</updated-at>
</line-item>
</line-items>
echo "LineItem.format = :xml\\nli = LineItem.find(:all, :params => {:order_id=>1}).first\\nputs li.price\\nli.price *= 0.8\\nli.save" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.20)
Switch to inspect mode.
>> LineItem.format = :xml
=> :xml
>> li = LineItem.find(:all, :params => {:order_id=>1}).first
=> #<LineItem:0x000000033e9290 @attributes={"cart_id"=>nil, "created_at"=>2014-02-04 20:42:40 UTC, "id"=>10, "price"=>#<BigDecimal:33f93c0,'0.288E2',18(18)>, "product_id"=>2, "quantity"=>1, "updated_at"=>2014-02-04 20:42:56 UTC}, @prefix_options={:order_id=>1}>
>> puts li.price
28.8
=> nil
>> li.price *= 0.8
=> 23.040000000000003
>> li.save
=> true
>>
echo "li2 = LineItem.new(:order_id=>1, :product_id=>2, :quantity=>1, :price=>0.0)\\nli2.save" | IRBRC=tmp/irbrc rails console
Loading development environment (Rails 3.0.20)
Switch to inspect mode.
>> li2 = LineItem.new(:order_id=>1, :product_id=>2, :quantity=>1, :price=>0.0)
=> #<LineItem:0x00000003c850c0 @attributes={"product_id"=>2, "quantity"=>1, "price"=>0.0}, @prefix_options={:order_id=>1}>
>> li2.save
=> true
>>
25.1 rack
21.2 Form Helpers