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.
$36.00
Programming Ruby 1.9 & 2.0
Ruby is the fastest growing and most exciting dynamic language
out there. If you need to get working programs delivered fast,
you should add Ruby to your toolbox.
$49.95
Rails Test Prescriptions
Rails Test Prescriptions is a comprehensive guide to testing
Rails applications, covering Test-Driven Development from both a
theoretical perspective (why to test) and from a practical perspective
(how to test effectively). It covers the core Rails testing tools and
procedures for Rails 2 and Rails 3, and introduces popular add-ons,
including Cucumber, Shoulda, Machinist, Mocha, and Rcov.
Rendered /home/rubys/.rvm/gems/ruby-2.1.2/gems/web-console-2.0.0.beta4/lib/action_dispatch/templates/rescues/diagnostics.html.erb within rescues/layout (14.7ms)
Started GET "/carts/wibble" for 127.0.0.1 at 2014-11-18 17:15:11 -0500
Processing by CartsController#show as HTML
Parameters: {"id"=>"wibble"}
Cart Load (0.1ms) SELECT "carts".* FROM "carts" WHERE "carts"."id" = ? LIMIT 1 [["id", 0]]
Attempt to access invalid cart wibble
Redirected to http://localhost:3000/
Completed 302 Found in 4ms (ActiveRecord: 0.4ms)
Started GET "/" for 127.0.0.1 at 2014-11-18 17:15:11 -0500
Processing by StoreController#index as HTML
Product Load (0.2ms) SELECT "products".* FROM "products" ORDER BY "products"."updated_at" DESC LIMIT 1
Product Load (0.1ms) SELECT "products".* FROM "products" ORDER BY "products"."title" ASC
Rendered store/index.html.erb within layouts/application (6.3ms)
Completed 200 OK in 83ms (Views: 80.0ms | ActiveRecord: 0.4ms)
Limit access to product_id
edit app/controllers/line_items_controller.rb
# Never trust parameters from the scary internet, only allow the white
# list through.
def line_item_params
params.require(:line_item).permit(:product_id)
end
rake test:controllers
Run options: --seed 33324
# Running:
......................
Finished in 0.272359s, 80.7759 runs/s, 161.5518 assertions/s.