Rails Cookbook
honestpuck writes "When reading the foreword of Rails Cookbook I felt a strong kinship with Zed Shaw, I too have fond memories of the first edition of Perl Cookbook and the way I relied on it once I'd taken the training wheels off. Since that one I have relied on several of the O'Reilly Cookbook series. It is only when I discard the early tutorial and dive in the deep end with a "cookbook" on my desk that I really start to learn proficiency." Read the rest of honestpuck's review.
Rails Cookbook
author
Rob Orsini
pages
514
publisher
O'Reilly
rating
7
reviewer
honestpuck
ISBN
0596527314
summary
for programmers who know something about web development but are early in their use of Rails,
I felt timorous and unsure when I finished Agile Web Development with Rails, a marvelous tutorial that introduced me to my first real web development framework (I must have enjoyed it, I just bought the second edition). Since I have volunteered to develop a fairly large and complex web application in Rails I awaited the arrival of my copy of Rails Cookbook with hopeful anticipation and bated breath.
Rob Orsini, his fellow contributors (15 in all) and the team at O'Reilly have once again delivered. Compared to the previous titles in the series I've owned Rails Cookbook seems to have fewer recipes but as it is tackling an entire application framework and some serious issues, some of the solutions and discussions run a lot longer. The book is targeted at programmers who know something about web development but are early in their use of Rails, though it should be helpful to all Rails developers.
The book starts with tackling issues of installation and getting development tools installed in the first two chapters. Despite already deploying a couple of simple Rails apps I found that there was the odd useful tip in these chapters. The book then covers each of the three main sections of Rails; Active Record, Action View and Action Controller. The rest of the book goes on with large chapters on testing, Javascript, debugging, performance and hosting and deployment. Along the way it also covers REST, Action Mailer, security, plug-ins and graphics.
The extremely large section on Active Record was to me the most useful. I seem to spend an inordinate percentage of my Rails coding time with Active Record and it contains a large part of Rails power so I appreciated the size of this chapter. By contrast the chapter on graphics is almost entirely unread.
It seems obvious that this book should be compared to Pragmatic's Rails Recipes. The first point of difference is that Rails Cookbook covers installation and setup. The second point is that is 'Recipes' covers Rails 1.1 while 'Cookbook' targets the brand new Rails 1.2. As a project fairly new on the scene Rails is a fast moving target so the six months between the two books makes a difference. Both books have excellent coverage of the various aspects of Rails, with a great deal of overlap. 'Recipes' has more, shorter pieces while 'Cookbook' tends towards longer pieces with more discussion. 'Cookbook' is also more general, with more recipes more likely to be useful in every Rails project you write.
The style is different between the two. Here Cookbook comes off second best, it feels as though tightly edited by a number of hands and ends up lacking personality; functional but cold compared to Recipes. The writing, however, is good. It's easily read, at times it feels like a good textbook. The layout is clean, it is easy to find the information you need from each recipe when you want.
With almost all "cookbook" style books I seem to be left feeling that a number of the recipes are just a little too obvious and covered well in beginner tutorials. There is some of this in Rails Cookbook, most notably the first two chapters, but overall the book will be useful to any beginner to intermediate Rails programmer. Personally I had a couple of moments where I read a tip and wanted to scream as it demonstrated and explained in a few short sentences and half a page of code what had taken me hours to discover for myself.
The "Cookbook" series all seem to be books worth the price and shelf space. This one is no exception. I'd give it three out of five with an extra half for its timely information on Rails 1.2 and would recommend it for all Rails programmers from the absolute beginner through to all but the most experienced. If you already have a copy of 'Recipes' and are happy with it then you might want to stick with that till either volume is updated for the next major revision of Rails, otherwise you will almost certainly appreciate a copy of Rails Cookbook.
You can purchase Rails Cookbook from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I felt timorous and unsure when I finished Agile Web Development with Rails, a marvelous tutorial that introduced me to my first real web development framework (I must have enjoyed it, I just bought the second edition). Since I have volunteered to develop a fairly large and complex web application in Rails I awaited the arrival of my copy of Rails Cookbook with hopeful anticipation and bated breath.
Rob Orsini, his fellow contributors (15 in all) and the team at O'Reilly have once again delivered. Compared to the previous titles in the series I've owned Rails Cookbook seems to have fewer recipes but as it is tackling an entire application framework and some serious issues, some of the solutions and discussions run a lot longer. The book is targeted at programmers who know something about web development but are early in their use of Rails, though it should be helpful to all Rails developers.
The book starts with tackling issues of installation and getting development tools installed in the first two chapters. Despite already deploying a couple of simple Rails apps I found that there was the odd useful tip in these chapters. The book then covers each of the three main sections of Rails; Active Record, Action View and Action Controller. The rest of the book goes on with large chapters on testing, Javascript, debugging, performance and hosting and deployment. Along the way it also covers REST, Action Mailer, security, plug-ins and graphics.
The extremely large section on Active Record was to me the most useful. I seem to spend an inordinate percentage of my Rails coding time with Active Record and it contains a large part of Rails power so I appreciated the size of this chapter. By contrast the chapter on graphics is almost entirely unread.
It seems obvious that this book should be compared to Pragmatic's Rails Recipes. The first point of difference is that Rails Cookbook covers installation and setup. The second point is that is 'Recipes' covers Rails 1.1 while 'Cookbook' targets the brand new Rails 1.2. As a project fairly new on the scene Rails is a fast moving target so the six months between the two books makes a difference. Both books have excellent coverage of the various aspects of Rails, with a great deal of overlap. 'Recipes' has more, shorter pieces while 'Cookbook' tends towards longer pieces with more discussion. 'Cookbook' is also more general, with more recipes more likely to be useful in every Rails project you write.
The style is different between the two. Here Cookbook comes off second best, it feels as though tightly edited by a number of hands and ends up lacking personality; functional but cold compared to Recipes. The writing, however, is good. It's easily read, at times it feels like a good textbook. The layout is clean, it is easy to find the information you need from each recipe when you want.
With almost all "cookbook" style books I seem to be left feeling that a number of the recipes are just a little too obvious and covered well in beginner tutorials. There is some of this in Rails Cookbook, most notably the first two chapters, but overall the book will be useful to any beginner to intermediate Rails programmer. Personally I had a couple of moments where I read a tip and wanted to scream as it demonstrated and explained in a few short sentences and half a page of code what had taken me hours to discover for myself.
The "Cookbook" series all seem to be books worth the price and shelf space. This one is no exception. I'd give it three out of five with an extra half for its timely information on Rails 1.2 and would recommend it for all Rails programmers from the absolute beginner through to all but the most experienced. If you already have a copy of 'Recipes' and are happy with it then you might want to stick with that till either volume is updated for the next major revision of Rails, otherwise you will almost certainly appreciate a copy of Rails Cookbook.
You can purchase Rails Cookbook from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I'm afraid I've been poisoned towards it by all the fans who have to insult other languages in order to promote it. I've never liked negative campaigning.
BlackNova Traders
I think this has been reviewed once or twice before on Slashdot... but I digress.
:)
I agree that this is a fantastic book, as it shows you some incredibly slick stuff you can do using Rails. But unless you already have somewhat of an understanding of Ruby then I'd strongly recommend getting a separate reference book just for Ruby by itself. O'Reilly makes one of those, too.
/* No Comment */
There are many things about RoR that really get on my chimes. I'm sure other users will be shortly listing things about rails that get on their chimes.
Rails is a pile of crap made by/for amateurs. ASP is for real work.
What stupid names too.
I bet you have never programmed a web app in your life... ASP? *laugh*
You can get it for $4 more at B&N
It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
fuckin6 numbers, Usenet posts.
I've seen so many slashdot book reviews with "rails" and "cookbook" in the title, that I could swear this book has been reviewed here already.
~= scwizard =~
I had this book for about 26 hours before I returned it, I was deeply displeased by the repetition from the existing work, Rails Recipes. All the cookbook entries about model relationships, polymorphic associations, etc, were lifted straight from Rails Recipes, right down to using Magazines, Readers and Subscriptions as the example objects.
And, while the book has a shiny "Rails 1.2" badge on the cover, very little of it had anything to do with Rails 1.2 whatsoever, there were only a handful of recipes in the very back which dealt with the new features.
Plus, was it really necessary to burn 3 pages talking about how to join a discussion group of fellow Rails developers? If you're a web developer and you can't find an online community to discuss the language/framework, you need more help than Rob's book is able to offer...
A critique of R&R. It basically says that it will not "catch on" for the same reason that Lisp and Smalltalk never did: heavy dependence on esoteric ideas and meta programming:
http://www.beust.com/weblog/archives/000382.html
Table-ized A.I.
Oh I tought it was about a cooking on the rails, like those things trains run on
but it is just about some programming thing
me sad
;;;
;;; Return (fib n) and (fib (+ n 1))
;;;
(define (two-fibs n)
(two-fibs-aux 0 1 n))
(define (two-fibs-aux m n i)
(if (zero? i)
(values m n)
(two-fibs-aux n (+ m n) (- i 1))))
Are you adequate?
Idle comes bundled with the Windows installer. I use that all the time. It is pretty simple, a colourized text editor mostly, but it doesn't have the pokey feel of Eclipse. About my only complaint about Idle is that it doesn't have any line numbering down the left side of the window. Instead the line numbers are in the lower right corner in a box which makes me look away from my code. It might be just me though.
t ro/index.html
An good intro to Idle follows:
http://hkn.eecs.berkeley.edu/~dyoo/python/idle_in
I own both titles ("Rails Recipes" by Chad Fowler) and IMO neither does a great job -- there's nothing in this book not already covered by the definitive DT/DHH Agile Rails Development book. About the only redeeming value was the information on Mongrel and the detailed instructions to get Rails installed and running on all the different platforms.
Speaking of which, though, the devoting of a good chunk of paper real estate to installation, seems to be space better left for meatier topics. Especially on a topic that changes significantly on a monthly basis -- it would seem that for a book, it would be more prudent to focus on matter not so ephemeral, knowledge that would arm and equip someone learning Rails to handle any task or illustrate more advanced techniques a web developer wishes to accomplish.
AZspot
If by "caught on" you mean "marketing douches for go nowhere wannabe web 2.0 startups put it in their want ads" then you are right. But most people think "caught on" means a significant number of people use it for a significant number of projects. And this is simply not the case. Of myself and the 5 people I know who tried rails, I am the only still using it. And I don't really want to, I am just stuck with it for now since I got stuck with reponsability for a site which someone else made that used rails for a large app which now is having all kinds of scalability problems. Given that less than half a million people downloaded it in the first place, if my 20% use vs try rate is accurate (probably WAY high) then less than 100,000 people are using rails. That's not even approaching 1% of "caught on" languages like PHP, java and C#.
And rails scales like shit, because its poorly architected and poorly written. Making ignorant claims about it scaling "just as well" as other shared nothing frameworks/appservers is retarded. Rails has several very large scalability bottlenecks that limit its ability to scale, most unfortunate being activerecord, which needs thrown in the trash. Christ, it makes us run a few thousand ruby processes, each with its own copy of every fucking class, each using ~120MB of RAM, and each holding a database connection open all the time even though 90%+ of the time the database connection is idle and the process is running application code. We have to use an external database connection pooling app just to fix this simple, basic fuckup because rails was not designed with *any* thought put into scaling at all. Nevermind how much this sucks balls for caching data, since you are now FORCED to use external caching like memcached, you can't have a useful level 1 cache in process.