rank trend

Ruby for Rails: Ruby Techniques for Rails Developers

by David Black
Released 2006-05-11
Read articles about Ruby
Buy it from AmazonNew for $32.81

54 Reviews

Sort by: Most Helpful ▲ Date Rating

5 stars This book is phenomenal - you just need to know when to read it.

2006-06-22     94 of 97 found this review helpful

I am extremely pleased with this book, and I think it's because I read it at the right point in my studies of Ruby and Rails. I have no Ruby background (Java, mostly) and wanted to pick up Ruby on Rails because of how great it all sounded - sidestepping so many of the problems of JSP/ASP/PHP/etc.

So, the first book I picked up was the PickAxe book, and read it pretty much from start to finish. It turns into a reference about 2/3 in, but the first part of the book is worth a straight-out read. That book gives you everything you need to get up and running with Rails, and has some brief coverage of the Ruby language, semantics, etc - enough to get you by.

Between that book and some Ruby language-related websites, I could build a decently complex web app. I discovered the various helpers from ActionView and got better at building good models with ActiveRecord, and understood the overall flow of the application. I was hooked on Ruby on Rails.

But, if you're like me, you eventually find some of the mystery frustrating. How does inheritence really work? Why do I see modules in some places and classes in others? How do you you make them aware of one another? When I generate a Rails app, what code is it building and where does it go? How come I can use the logger object in my controller, but my helpers can't see it? How does active record know about my database fields?

The mysteries pile up and you eventually need more, but I found the general purpose Ruby book "Programming Ruby" wasn't sticking with me. It covered a ton of topics I didn't care about, and the ones I did care about I didn't realize I was supposed to, because it wasn't obvious how the Ruby in the book related to Rails.

Then I picked up this book - and it was *exactly* what I was looking for. It has answered every question I've listed above, and I'm only halfway through it. I'm finding that I'm actually *understanding* what's going on with Rails under the hood.

Admittedly, if I'd started into this book as a primer for Rails, or a Ruby reference, I probably would have been disappointed. But, that's not what this book is all about. This book has a very important place in the process of one's learning about Ruby and Rails. At this point in my learning, I've found it to be perfect.

2 stars Very Repetitive, Slow Read for New Programmers only

2006-06-26     11 of 11 found this review helpful

I was really disappointed with this book. It got very good reviews so I bought it without ever looking inside. It says it's written for programmers from many different backgrounds, but it's really for fairly new programmers. The author repeats himself a lot and is incapable of stating things in a concise manner.

I would prefer a book that gets right to the point and highlights what's important or not intuitive. The intro section on MVC is a good example of his repetition. You find yourself thinking you're reading the same sentence several times.

You'll still learn a good amount about Ruby and Rails from this book, but if you've been programming for a while you'll be aggravated by the pace this books introduces the material.

So in short, if you are relatively new to programming, this could be a good book for you. If you are looking for a quick start this may also meet your goal, but it's done in about twice (maybe three times) as many pages as necessary.

5 stars A great book for Newcomers

2006-09-12     10 of 10 found this review helpful

The book's preface indicated that the author is well versed in Ruby, and that he got into Rails when it was brand new. It sounded like he was in a position to teach the subject matter well, and I really liked his angle: Rails was written in Ruby, and Rails extends Ruby... you really cannot fully utilize Rails without learning Ruby, and this book teaches you all about Ruby, with an eye on Rails. Perfect!

There are four parts to the book. The first part is an introduction which explained how Ruby works, how Rails works, and why it's important for Rails developers to have a good handle on the Ruby programming language. This was more detail than I had gotten in my online reading, and not so much detail that my head blew up immediately. A real plus. Also in the first section, we walked through the beginning of the development process for a simple "music store" web application. This defined a context for the pieces of the Ruby puzzle that were about to be dumped on the table.

The second part of the book really delved into the guts of Ruby programming. It defined objects, variables, classes, instances, constants, modules, methods, inheritance, scope, and control flow techniques. It had been 8 years since I'd done work in Java, and that was my only experience with object oriented programming. Ruby is kind of the same, but not really.

The third part of the book is all about the classes and modules that are built in to Ruby. This is very important stuff, necessary in order to get a feel for what you can do (manipulations and comparisons) with different data types. And there is a lot you can do. This part also describes how arrays, hashes, and regular expressions work in Ruby.

The fourth and final part of this book re-focuses on the music store application from earlier in the book. Once you've gotten a tour of Ruby, you see Rails development in a different light. Controller and model files look different when you have a feel for what you're actually looking at. With your new perspective, the author walks you through several improvements, bringing the online music store closer to reality.

As a kind of a bonus, the final chapter of the book gives some techniques for learning more about Rails (and really, Ruby, too.) This is very good stuff! How do you search through the Rails code to find the section that pertains to your question? How can you more effectively search online documentation? Answers to these kinds of questions can really help a person grow, because once you become an intelligent troubleshooter, the only thing holding you back is your own level of motivation.

5 stars Impressive

2006-05-14     10 of 11 found this review helpful

There are many good books on Ruby, and on Rails, so many deservedly 5-star rated ones, that you'd think there'd be no room for yet another one.
Until you read this one.
The author covers everything about Ruby, and he has a special feel for those important, but advanced and sometimes difficult points, which you've always wanted to understand, but didn't quite grasp.
His sense of humour is especially nice, because besides keeping up the reader's attention, David's elegant formulations are always to-the-point pedagogic (besides being funny).
The author's claim is that you should know Ruby well in order to fully exploit Rails.
Yes, after studying this book, it becomes obvious that he's right. Invest some time (hours, days, weeks, depending on your start level) on studying this book and its examples, and you'll become very proficient in Ruby (even the advanced topics), and at the same time you'll have gained a much deeper working knowledge of Rails.
Highest mark on "value for money" ratio. It's probably the best computer book I've ever studied.

2 stars Not enough Rails

2006-05-31     8 of 15 found this review helpful

My expectations for the book may have been too high but I have mixed feelings. The book is 470+ pages but only a little more than 100 pages are devoted to Rails. As a Ruby starter book, it was ok but it missed the mark for Rails. By the end of the book I did create a simple shopping cart application with hyperlinks and partial pages but that was about it.

I did learn that "id" and "..._id" are special field names, and table names must be plural. And one obscure sentence on page 387 mentioned that a field named "created_at" creates a current timestamp during inserts. Are these the only special names within Rails? Also, how do I work with complex tables which have multiple foreign keys to the same table?

This book left me frustrated. It teaches you how to extend Rails but doesn't adequately show what's already there. If you want a Ruby book with some Rails thrown in, it's pretty good. If you want a hard-core Rails book, this isn't it.

5 stars Clear but a bit verbose

2006-12-04     7 of 7 found this review helpful

I found this book to be absolutely essential to understanding what I was doing while programming with Rails. After reading this book a lot of things became clear in the Dave Thomas book (Agile Web Development with Rails). If you're thinking about hiking up the Rails learning curve, you'll be most of the way there once you finish this book. I had no previous experience with Ruby, but I have programmed in C++, Java, PHP, LISP, Javascript, and several other less well-known lanugages. Probably for that reason, I thought it was kind of a slow read. However, I think it would be a great book for people with no prior programming experience. It would make a great textbook along with Thomas's book. Personally, I much prefer a clear, verbose style than a terse style that assumes a lot of prior knowledge. I read this book after Dave Thomas's book, but I recommend reading this FIRST (or closely along side of it).

2 stars I don't quite like it

2006-09-20     7 of 10 found this review helpful

this maybe against the popular opinions, but the book is thick on author's philosophical thinkings (and the author is obviously fond of) on how various things are tied together, but thin on the actual things that you can do, and what to do. You have to wade through bunch of such mommy and apple pie stuff to get the point, which is a a pain. On the other hand, if you have plenty of time, and want to take it to savor the good of either ruby or rails or their interconnects, maybe it is the right book.

4 stars Required Reading

2006-08-17     7 of 7 found this review helpful

If you are one of the many new developers coming to Ruby through Rails, this book is certainly required reading.

Within these pages you will find a solidly paced and effective tutorial of the Ruby programming language. The book speaks to programmers with only a little experience and yet experienced Rubyists will likely learn a few things by the end. I know I did.

The book does a nice job of keeping the material Rails centric. Examples often show a Rails slant, though the concepts are primarily vanilla Ruby. This allows you to learn powerful new techniques that will likely help you in many new areas while staying focused on the current goal.

This book also has the best description of Ruby's "singleton classes" yet put in print. It's probably of value to all Rubyists for that alone.

I highly recommend this title.

5 stars Be a Bullet Train!

2006-06-06     7 of 11 found this review helpful

Ruby is a popular dynamic programming language with a rapidly growing following. Rails is a Web application framework for Ruby that is also taking off quickly. This book starts from the premise that many smart developers are adopting Rails on its own merits, with minimal prior knowledge of Ruby, and that those developers need to learn Ruby, fast!

It turns out that this is a great premise for a book. In a tight, focused 17 chapters, David Black tells the reader everything she'll need to know about Ruby to get the most out of Rails. Topics that a Rails developer won't use (for example, GUI toolkits) aren't covered here. Instead the author concentrates on Ruby language features, programming idioms, and libraries that are common to all Rails applications.

The very first chapter is a gem. It explains in generous detail where to get Ruby, how to install it, how to run it, how to debug it, how to extend it, how to maintain an installation, how it's documented, and introduces the language syntax, all in two dozen pages. Much of this is treated as advanced material by other Ruby books, but every Ruby developer worth their salt needs to know it all.

Chapter 2 does something similar for Rails, helping you to understand the whole thing well enough to know how the pieces fit together. Later chapters concentrate on the Ruby language, and then on Rails again, always with an eye for optimal ways to use these technologies together.

Whether you're new to Ruby and Rails or just need to learn how to get the most out of this powerful combination, this book is a winner.

3 stars Not recommended for an experienced programmer

2007-04-21     6 of 7 found this review helpful

David Black must have been paid by the word. He could have distilled out 5 to 10% of the verbiage and had an easier to read book. But, if you like a rambling writing style you'll think this book is great.
The material was covered well but there were too many unnecessary parenthetical phrases, adjectives and adverbs.
Example: "This, too, prints "Hello". Apparently the variable abc also contains "Hello", thanks to having had str assigned to it."
Would be easier to understand if it were written;
This, too prints "Hello" because abc is assigned to str.

5 stars The book I had been waiting for

2006-08-19     6 of 6 found this review helpful

Ruby for Rails really covers how ruby and rails fit together and the idioms that derive from each.

The book covers a lot of ground, some of which is only relevant to those new to OO programming, but these section can be easily skimmed. For the experienced programmer it also covers a number of Ruby features that are not basic such as singleton methods, method rebinding plus some meta tasks e.g., using 'method_missing', trapping inheritance etc.

I've read two other Ruby/Rails books and they were very helpful in coding my first Ruby app last year, but they left me with many questions about how things really work.

This book answered most of those questions and opened up a couple of new doors that I didn't even realize were closed.

1 stars Overly verbose and just not practical

2006-08-10     6 of 21 found this review helpful

Prior to purchasing this book I checked amazon and it has 4.5 stars so I bought it w/out reading the reviews. Upon finishing the first few chapters I am now extremely disappointed and looking to return the book to find something that better fits what I'm looking for.

The reason I bought the book (which I assume is the same as most): I am building my first couple of sites with Ruby on Rails - I've built a hundred in the past with a hundred precursor technologies - and I would like to find a book that assumes I get MVC and just gets to the point. So I'm looking for practical assistance - and clearly I wasn't the target of this book.

My primary issue with the book is that although there's a lot of valuable content the author rambles, the sections are very verbose, and thus it is hard to find the important information in the sea of word clutter. For example, pages 16, 17, 18, and 19, are all dedicated to half a dozen command line flags on the ruby interpreter. In a more practical and concise book written for programmers something like this could easily be handled in a single paragraph or graphic with a sentence or two dedicated to any key points wrt the command line. I'm sure there's some valuable data in those four pages - but frankly I can't read four pages trying to look for the needle in the hay stack.

If you are looking for a really practical rails book that helps you get up and going and on your feet quickly and then provides concise and crisp data to take you to the next level I don't think this is the right book for you. Unfortunately I don't know what the right book is - I'm headed back to the bookstore now to try again.

5 stars Best book on Ruby (for Rails)

2006-06-02     6 of 7 found this review helpful

I must say that this is the best book I have ever read about any programming language.

I have all the other Ruby On Rails- books that are available. I also have the Pickaxe, which more of a reference book, not really for learning the ins- and outs of the language from scratch.

This book is beautifull. David Black has a superb way of explaining the deap insides of Ruby - objects, methods, mixin's, it almost reads like a philosophical discurssion - and sometimes it's like poetry. The stuff I did'nt understand when I read other books I understood immediately when reading Blacks pedagocical explanations.

I have decided to read all of this book before I finish reading any of the other Ruby on Rails-books out there.

Also I think that it is extremely helpfull to know Ruby before trying to learn the advanced stuff of Rails. And to know what is Ruby and what is Rails.

Really all of Rails is Ruby - so learn Ruby first, then practice it with Rails.

Per-Olof Hermansson

5 stars Excellent intro to Ruby and Rails

2006-05-24     6 of 6 found this review helpful

My introduction to rails started with the Agile Development book, which is great, but I kept asking myself - how much of this is Ruby? and how much is specific to Rails? . Ruby for Rails provided me the answers.
I really enjoyed reading this book. Even when it covered material that I already knew, it still offered a few new tips for me.

I discovered a couple confusing items in the book, and I used the author's forum to ask questions. The author answered my questions, clearing things up for me. I was very impressed.

4 stars Teaches Ruby using Rails

2008-01-26     5 of 5 found this review helpful

Approaching this book, I wasn't quite sure where the emphasis lay, and who this was aimed at. To be clear then, I recommend this book to an intermediate Ruby programmer, who is interested in using examples from Rails to help cement their learning. It would also probably help to have the vaguest idea of what Rails is, and the sorts of web apps it's useful for. If you're an existing Rails developer, this is a great way to get a better understanding of what's going on, but it's not a tutorial on Rails for a complete newbie, nor does it provide advanced Rails practices.

Unlike many programming books, which focus on procedural programming before building up to classes, RfR is admirably object oriented in focus from the word go. It's quite impressive that conditionals aren't introduced until about 200 pages in. Also notable is the chapter on metaprogramming, which is very good. If you felt a bit short-changed by the coverage of this subject in The Pickaxe, this is much better.

Material on Rails top and tail the book: the first part introduces Rails by building a simple web app, and the final chapters rejig it with enhanced models, views and controllers, based on the Ruby material in the middle.

In short, this is more of a Ruby book than a Rails book, and I was very happy with that. This is well worth getting even if you have no interest in web apps.

5 stars Fills in the blanks

2006-12-06     5 of 5 found this review helpful

I too was enticed to study the Pick Axe book and the Agile Web Development for Rails as the 2 definitive guides to learning Rails. This book seemed to get less comment and reference from the Rails community. After a few months of study and practice, I found myself frustrated and unable to put all the concepts together in a cohesive manner. Pick Axe explains everything there is to know about Ruby down the gnat's arse. Great for understanding Ruby concepts, but often hard to put into practice in a Rails app. The Agile Web Dev book walks you through what I would call a very simplistic application. Don't get me wrong, it's helpful....just simplistic in my estimation. Hopefully the second edition (do out any day now) will cover a more complex app.
This book starts by building a basic Rails App for 3 chapters, then delves into teaching you Ruby programming, along the way tying it to real world Rails development. The final 4 chapters are where everything finally came together for me. These sections take what you've learned, and apply them to a more complex, real-world application with many-to-many tables, rendering partials, DRY'ing up redundant code etc. It was everything I felt was lacking in AWD and Pick Axe. This is the best Rails book for putting it all together and making it work in a real-world App. A must have reference, especially if you don't come from an OOP background.

5 stars Great intro to ruby, ruby for rails from beginner to intermediate

2006-09-29     5 of 6 found this review helpful

chapter 13 - Ruby dynamics is worth the price by itself.
This is a great reading for newcomers to ruby whether you've been programming before or not. I have about 10 years of web development experience and came to love ruby through rails.
Like many people I started playing around with rails and a lot of it felt like black magic. Looking at rails source code didn't help either;(
Almost 2 years later, after reading the pickaxe book, the agile rails development and developing a dozen sites, Ruby for rails still delivered.
It helped me understand some ruby idioms that still felt a bit like black magic. It also invited to explore certain aspects of the programming language and to look at it from a different point of view.

This is not a book about rails, this is a book about ruby idioms that will help you get the most out of rails and any other ruby-based project that you'll get involved.

The book does feel at times a little slow but it's never dull. The "perceived" slowness might be avverted because by the author makes sure the reader has no doubts about a concept with plenty of code samples before moving on.

For those guys that found it redundant, I say it was just a feeling, you might have either missed the point or maybe were already well to familiar with whatever concepts you found redundant.

I reccomend this book to any newcomer to ruby or rails and to intermediate programmer that might not too familiar with the ruby idioms.
If any of the following lines of code puzzle you, you need this book

p = lambda{|h, k| h[k] = Hash.new(&p)}
hash = Hash.new(&p)

if SAFE_CONTACT_KEY_VALUES[eval(new_detail.capitalize)]
@contact_detail = contact.__send__(new_detail).new(SAFE_CONTACT_KEY_VALUES[eval(new_detail.capitalize)].call(params))
end

c = C.new
class << C
include M
p ancestors, self.inspect # do you know what is self right now?
end

4 stars A fantastic guide to Ruby for programmers of all skill levels

2006-08-06     5 of 5 found this review helpful

You might imagine that David Black's Ruby for Rails is a quick run through Ruby as an attempt to cash in on Rails hype. While I'm sure the interest in Rails helped in getting this book published, this is not a quick cash in attempt. This is one of the best Ruby books available. Dare I say this book tops the esteemed PickAxe (ie Programming Ruby: Second Edition) by the Pragmatics? Maybe...

David Black is a director of Ruby Central, ruby-talk regular, consultant and presenter. He knows and loves Ruby, and it shows in this book. His style is informal and easy to read. My only (minor) complaint is that its a bit verbose at spots, with some points being made many times over in different chapters.

The book is divided into four parts. Part one is the standard "quick-start" piece, with three chapters doing a quick overview of Ruby and Rails. He also introduces the Rails app that is used for examples throughout the book, R4RMusic - a classical sheet-music store. One minor nitpick is that Black uses straight sql instead of migrations for his database setup.

The second part cover's the fundamentals of Ruby, so if you've read the PickAxe or one of the online intros much of this will be familiar. He covers modules and classes, control flow, exceptions, and variables and methods. Experience programmers from other languages can probably skim through this pretty quickly, but those newer to programming will find this material invaluable. There is also a chapter devoted to the all important role of self and how scope works in Ruby. This helped clear up some confusion I had about just where methods go when they are declared at the top level, and where and where "functions" like puts and friends come from in irb.

Part three covers the core libraries, regular expressions, and metaprogramming. String, Numeric, Time, Date, Array and Hash are discussed in depth, with plenty of examples, which is always helpful if spent any time trying to figure things out with the online api. The regex chapter is one I continue to return to, as I can never remember the syntax needed to get typical things done.

Chapter 13 is the metaprogramming chapter, titled "Ruby Dynamics", and my favorite out of the whole book. Black first covers the oft-misunderstood singleton class, how to access it and modify it, and where it lies in the message chain. Class methods are explained as a special case of singleton methods on objects of class Class, using some helpful diagrams to show how inheritance works with all of this. The eval family of methods is then covered, starting first with the redheaded stepchild "eval", followed by little brother instance_eval, finally covering everyone's favorite girl next door: module_eval, aka class_eval. If you've done any digging in the Rails source or done metaprogramming yourself, you've probably seen or used it. Its one of the most commonly used methods for adding or changing methods at runtime in Ruby.

Procs and lambdas are explained well along with their relationship with blocks. This section includes a nice analogy for closures:

"Creating a closure is like packing a suitcase. Wherever you open the suitcase, it contains what you put in it when you packed it. When you open a closure (by calling it), it contains what you put into it when it was created."

Callbacks such as method_missing, included, and inherited are covered, with an illustration from ActiveRecord::Base.inherited showing how new AR subclasses tracked using the callback. There is an all too brief section covering open classes and how to change existing methods, and the dangers that come with that power. The one problem I had with the entire dynamics chapter is that I wish there was more of it! The content is spot-on, but there could be a whole separate chapter discussing the pros and cons of the various methods available and idiomatic metaprogramming versus inadvisable techniques.

Part four is the final and most Rails-heavy section. He walks through building up a rich domain model through adding on to the ActiveRecord models and also how to separate functionality in the view with helpers and partials. Much of this content was not new to me, having already covered much of it with the Agile book, but I can see the value for newer Rails programmers. My second fave chapter, 17, explains techniques for exploring the Rails source. The ActiveRecord class method "belongs_to" is used for the primary example, but again I was frustrated as it seemed Black only scratched the surface of what is going underneath. A whole chapter could be done just showing how a belongs_to association is generated and handled, and could use the Rails source to illustrate some of the common metaprogramming techniques that you see in Rails and elsewhere. As it is the coverage of belongs_to goes far enough to show how the methods goes from an instance method in ActiveRecord::Associations::ClassMethods to a class method available to ActiveRecord::Base. Whiles its enlightening, I wanted more from this chapter.

Overall, Ruby for Rails is an excellent book. My main complaint has to do with wanting more advanced, in depth material, and given the amount of ground the book does cover (just under 500 pages, btw) I understand the book had to be completed in a reasonable amount of time. The material that is covered is explained clearly and patiently, with a lot of coverage given to the core classes and object model that make up Ruby. For Java/.Net refugees or those Ruby beginners looking to enhance their skill with Ruby, I would strongly recommend this book. And yes, I'd even recommend it over the PickAxe.

5 stars Awesome

2006-07-18     5 of 5 found this review helpful

This book is a must have for Ruby on Rails developers.

While you could develop Rails applications without understanding Ruby, to do would completely miss out on the reason Rails was created in Ruby. Ruby is a powerful and enjoyable language.

For those of you that do not know of David Black, here is a part of the bio from his book: "A Ruby community leader, David Black is the director of Ruby Central, the parent organization of the annual International Ruby Conference (RubyConf) and the International Rails Conference. David is a Ruby core contributor and the creator and maintainer of RCRchive."

The reasons you must know Rails to become an effective and efficient Rails programming machine:

1. To understand the Rails source code

2. To make your Rails apps do something beyond pushing data in and out of a database.

3. To take advantage of "Ruby everywhere"

4. To use Ruby for non-Rails tasks (automation).

5. To enjoy developing Rails apps!

There are books on Ruby and there are Books on Rails. David Black is one of the few authors out there that can lead you over the bridge that connects Ruby and Rails. David has a deep and broad understanding of Ruby that he puts to great use in this book. He uses this knowledge to lead you through not only how Ruby works, but also how Rails uses the power of the Ruby language to deliver an efficient and enjoyable framework. Here are some topics he covers:

Part 1: The Ruby Rails Landscape The first two chapters are introductory overviews to getting your "Hello World" Ruby and Rails programs running. For anyone that has written a Rails program, there is not much new in the first part of the book.

Part 2: Ruby Building Blocks The next section has a very interesting discussion about Rails as a domain specific language and how Rails feels more like configuration vs. programming. For example, David shows how the Rails declaration has_many :editions is a method call that could be written in several different ways. The Rails idiom of has_many :editions is syntax that makes Rails feel more like configuration and less like programming. This same method call could also be written in your controllers as send("has_many", "editions".intern) or has_many(:editions).

Similarly, David's discussion of Ruby "syntatic sugar" is enlightening. Syntatic sugar of Ruby allows the programmer great power in the setter methods. It does it more easily and cleanly than other languages (in my opinion). For example, in the setter method def price=(amount) @price = amount end

the method name is "def price=". To call the method would look like this: ticket.price=(65.00). By allowing you to put a space before the equal sign in the method name and allowing for parens to be optional, Ruby allows for a much more pleasant: ticket.price = 65.00

What makes Rails great is the combination of Ruby's flexibility as a language and ability to support "syntactic sugar" and the Rails community's positive support for coding conventions that have created standards. When reading and writing Ruby for Rails code, it is important to understand the differences between what is a Rails community standard and what is a Ruby language expectation. This understanding will give you the powers itemized above.

This combination of technical and philosophical conversation continues throughout the section brining to light important information on managing classes, constants, modules and mixins, control flow statements, and error handling. The books description of how Ruby yielding works is a valuable read and is a good example of how this book helps you understand what is going on in a Ruby program and how to become a good Ruby and Rails developer.

Part 3: Built-In Classes and Modules This section is pure Ruby and describes things such as scalar objects, containers, collections and regular expressions. In my current project, this book's 24 page discussion on Ruby regular expressions was worth the price of the book itself, allowing me to replace custom methods I had written with a few lines of regex. (email me at scott [at] synapsoftware [dot] com if you want the technical details on this statement)

Part 4: Rails Through Ruby, Ruby Through Rails The book concludes with a step by step walkthrough of the sample application. It discusses not only the how but also the why of Ruby on Rails design decisions. That is what I liked best about this book. The final chapter invites you to learn more by exploring the Rails source code. It steps through three techniques for discovering how Rails leverages Ruby.

My only complaint: a chapter on the testing framework should be added. Unit tests are such a big part of the Rails development experience that they should have been covered.

Read this book and become the next Rails star on your team.

5 stars When you want to understand how rails works get this book

2007-06-02     4 of 5 found this review helpful

This book should be in the first five books you get on Ruby/Ruby on Rails. It tells you how things work under the covers and brings your Ruby knowledge up to par. You can write Ruby on Rails applications without this book, but once you really want to understand what you are actually doing with symbols, hashes, modules, classes, etc, then get this book.

4 stars Couple this with Agile Web development with rails and your set

2007-04-22     4 of 5 found this review helpful

This is the *perfect* compliment to agile web development with rails (2nd ed). If you read this book alone you would not be up on all that rails has to offer. For instance this book does not even really step into migrations. Also, this book is quite old in 'rails time' meaning alot of things that have been changed/included since this publication are not there (if they would be there to begin with --because this book is on ruby and how it applies to rails, not showing you rails only methods, ). However, if you just read "Agile Web Development with Ruby on Rails" you would/will not understand the in's and out's of getting what you need done (unless you are already a 'rubyist').

You really need this book in compliment to rails centered book. My recommendation (and what I did) was to read Agile Web Development with Ruby on Rails and then read this book to explain it all to you. This book is NOT a re-hash in any way of agile web development and will not bore you. The writer explains things well and gives you a very good basis for writing more capable and more efficient rails (and even non-rails) applications.

As it states in the book, and I agree, people do not understand that ruby on rails is a RUBY application. I believe the more correct name for ruby on rails should be rails ON ruby. You can't (shouldn't) get away from ruby when you are writing rails. Most this you take for granted in rails is actually ruby code anyway. If you want to make a capable application then you need this book.

The reason I gave this book 4 stars (as I did with Agile Web Development) is because I feel this two books should be merged into one. It's kind of a pain to revisit certain things between the two books when one [book] should be able to do what these have seperated. It is also a pain to have to purchase two books :).

2 stars 4 Non-programmers

2007-02-19     4 of 8 found this review helpful

The concept of this book is quite interesting, but it really falls flat on execution. The biggest problem here is that this book is not just an introduction to Ruby, but an introduction to programming. The text is incredibly pedantic, explaining the most basic concepts of logic and object-oriented programming (in a pretty poor fashion, to boot). This makes for a painful reading experience for anyone with a programming background. This book appears to be for non-programmers trying to get into "this web development thing". Unfortunately, it covers very little of how to actually build a Rails app.

There were a few interesting tidbits here and there about how Rails uses special features of Ruby to accomplish its magic, but in general I was disappointed since this is the area where I was expecting to get the biggest benefit.

If you're an experienced developer looking for an intro to Ruby on Rails, look elsewhere - the online Ruby book as well as "Agile Web Development with Rails" are much better.

5 stars Appreciating OO through Ruby

2006-08-12     4 of 4 found this review helpful

The strength of this excellent book for me was the material on Ruby itself. I am forever confounded when I try to explain to other Java developers that Java doesn't really give a real sense of OO - that it only goes half way. If someone were to invest the time to learn Smalltalk or Ruby that would do it, but that's often too much to ask just to satisfy some intellectual curiosity. But you can get a real sense of it just by reading the Ruby chapters of this book. I think that many readers will approach development in a new way, even in Java, and I can confirm at least one success. Thank you Mr Black for describing Ruby and the zen of OO with such eloquence and passion.

5 stars Terrific Tutorial

2006-05-26     4 of 5 found this review helpful

For a practicing designer and developer, this book is an ideal introduction to both Ruby and Rails.

The content list looked good enough to buy it--especially since, as someone wrote elsewhere, it spends a fair amount of time on "those interesting language features you wish you understood a little better".

So I was excited to crack the covers. But when I started reading it, I was even more impressed. It's beautifully written, and brilliantly sequenced. The introductory chapters are light and easily read but, even so, they contain a variety of useful tidbits that make it worth a read.

An impressive amount of thought obviously went into sequencing the material, as well. That sequencing keeps things simple at the outset, while laying the founcation for more complex topics to come.

In the section that introduces IRB in Chapter 1, for example, the author sneaks in the little tidbit that an assignment is an expression that has a value. That point will become important when more advanced concepts are discussed, so I was struck by how adroitly the concept was presented early on--innocuously, almost innocently.

Frankly, it's a book I wish I had written. If I were teaching a course, I would be inclined to use this book as the text. Like Joe O'Brien at ThoughtWorks, I would use unit testing as the primary teaching mechanism, build those tests around the well-sequenced examples in the book, and use the book for additional explanations.

In short, I'm glad I have it to read.

5 stars Great for moving from Rails to the entire Ruby world

2006-08-16     3 of 3 found this review helpful

Just playing with Rails showed me just how much is out there in Ruby, but sticking with what I knew didn't let me reach any of that cool stuff. This book taught me Ruby itself, and now my Rails coding is a lot more efficient. Ruby rocks!

4 stars Good

2006-08-04     3 of 3 found this review helpful

This is an exceptionally well-written technical book. The style and content of the book reflect an author who can think clearly, explain clearly, and who is an expert on the subject. However, my criticism is that interspersed throughout out are some looooong passages passages of bla bla bla stuff. A typical one on page 69 begins "It's hard to imagine that a case needs to be made for understanding your own code, but it's worth a few words." The author spends a lot of time explaining the motive and philosophy behind the book. Nonetheless, if you read this book and work through the well-designed and detailed examples in it, you'll get very good at Rails programming.

I think this book would be most useful to someone coming from another object-oriented language. If you're starting to learn programming or object-oriented programming, this book will confuse you. If you're already a Java developer, you'll have no problem.

5 stars The Missing Bridge Between Rails and Ruby

2006-06-22     3 of 4 found this review helpful

I worked by way through the Agile Web Dev (AWD) book until I got bogged down in the CRUD chapters. At that point I decided I really needed to know some more Ruby to progress further so I bought and read most of the Pickaxe book. I then went back to AWD and read the rest of the book. But there was still something missing, something that would explain more about how Rails uses Ruby

Then this book was released and I immediately purchased it. Im very glad I did. This book really does fill in the holes in my understanding of how Rails works. By working methodically through explanations of features of the Ruby language, and through Rails examples, the author does a great job of explaining all the ins and outs of Rails.

The timing for me, could not have been more prefect. I would like to congratulate the author on a job well done and look forward to meeting him at the next nycruby.org meeting.

4 stars Excellent Ruby Reference

2006-06-22     3 of 4 found this review helpful

For last couple of years, I have mainly rely on Dave Thomas'"Programming Ruby", but I found this book complementary to DT's book. Though, this book covers Ruby basics such as basic constructs, expressions, exceptions, YAML, etc, but not as much detail as DT's book. Also, it didn't cover xml, cgi, network, threads, drb, testing and continuation. However, it covered a number of other topics such as collections, singleton methods, blocks/lamdas, eval, etc. in much more detail. The only disappointment was that I found link to Rails a bit weak. Though, this book had a few examples of Rails code and Rails application code, but it didn't cover much of the internals of Rails especially metaprogramming and DSL, which is the heart of Rails framework.

4 stars Solid introduction to Ruby but skims over Rails

2006-06-22     3 of 5 found this review helpful

This book definitely gives a solid foundation for Ruby. Rails is briefly discussed in one of the parts.

I began reading this book with great interest and by the end of the book my interest had hit rock bottom. I learn best by examples and by doing exercises. This book just goes over snippets of code, Ruby related code can be executed in the irb session but Rails code has to be downloaded separately.

I did not find that it was effective to just show some snippets of Rails application code and just describe it in detail. This was the boring part of the book.

Also as a application developer I want to learn the most often used techniques and not spend too much time on things that are not used that often. So I skimmed some parts of the book and focused on core aspects of Ruby and Rails.

I would definitely go back and refer to this book when I need some help in solving programming problems with Ruby and Rails. I wish the Rails part of the book covered bit more ground. It left me wanting more Rails related info in the end. Is this book an appetizer for a follow-up book Rails Quickly by Manning?

5 stars RUBY "RED" RAILS

2006-06-06     3 of 6 found this review helpful

Are you a computer practitioner? If you are, then this book is for you. Author David Black, has done an outstanding job of writing an introductory book to the Ruby programming language.

Black, begins by providing a broad overview of the Ruby programming environment. Then, he gives you a guided tour of the basic structure of the Ruby on Rails framework. The author continues by plunging you into the process of understanding in specific terms the ways that knowing Ruby well can help you as a Rails developer. Next, he takes a close look at Ruby objects and variables. Then, the author explores how you can organize and automate objects using the aggregation techniques made available by Ruby's class and module mechanisms. The author continues by examining matters of scope in Ruby. Next, he introduces Ruby's control-flow techniques. Then, the author covers some preliminaries that will help you get your bearings in the subsequent chapters. He also deals with scalar objects. The author continues by covering Ruby's built-in collection classes. Next, he discusses regular expressions and, with that material in place, circles back to discuss string- and array-related methods that use regular expressions as arguments. Then, the author introduces you to dynamic Ruby. He also examines the domain model and database re-design. The author continues by adding custom-written Ruby code to the model files, by way of enhancing and augmenting model functionality. Next, he covers the updates and changes to the controller and view files, bringing to a close the revision of the application. Finally, he demonstrates a variety of techniques for finding your way around the Rails framework source code and familiarizing yourself with it.

As this most excellent book proceeds, the center of gravity shifts back and forth between the Ruby language and the Rails framework. Overall, you'll be rewarded not only with a dramatically greater understanding of Rails, but also with the beginnings of expertise in a very attractive, adaptable, and popular programming language.

5 stars A must have when starting out with Ruby on Rails

2007-06-07     2 of 2 found this review helpful

I half read "Agile Web development with Rails" and while I found it very good on getting me upto speed with Rails, I was lost in some of the Ruby code. This book explains the Ruby code and fills in a lot of the blanks. I now regularily switch between the 2 and find I have all the information I need at my fingertips. (It also helps to have the pick axe book to hand). Ruby is the language I have always known existed but couldn't quite find before Rails came along.

5 stars Indispensable!

2007-05-17     2 of 2 found this review helpful

There's little I can add to what has already been mentioned in the other reviews for this book. However, I would like to say that this book made the Ruby/Rails duo very much clearer. I had already purchased and mostly read the other two obligatory books (Agile Web Development with Rails and Programming Ruby), but the concepts weren't clicking. (Perhaps I'm getting old.) This book immediately lifted the fog and provided me with the elusive but rewarding "Ah-ha" moment.

Many Ruby on Rails tutorials step through the creation of an entire application with the byline of "how easy/cool/fun" the process it. However, such tutorials raise more questions than they answer. This book's code snippets are surprisingly small - a very good sign - since the author steps through the concepts line by line and intuitively answers your questions as they come to mind. It is very well written, highly valuable and well recommended.

5 stars Excellent, but wordy

2007-05-14     2 of 2 found this review helpful

Being new to both Ruby and Rails, I read both the Agile and Pickaxe books cover to cover, then read Ruby for Rails which really pulled it all together for me. Now the "magic" of Rails is much less a mystery.

The book is a bit wordy. But its conversational tone makes it readable rather than a just a reference. The author seems to first explain what he's going to explain, again says what he's going to say, then finally says it, then tells you what he just said. And the cycle repeats! Thus the book starts out slow. But by the middle of the book, when we're into some much more complex concepts, I really appreciated that approach.

One thing is certain, you cannot/should not use Rails without a clear understanding of the Ruby language. This book was very valuable to me.

5 stars Crossing the chasm: Ruby to Rails

2007-04-22     2 of 2 found this review helpful

Ruby for Rails fills an important gap between the pickaxe (Programming Ruby) and Agile Web Dev. with Rails. Agile will give you a gentle introduction to Rails, pickaxe will be your Ruby reference, but Ruby for Rails will help you cross the chasm from an everyday Rails user to a power programmer who is comfortable with the crooks and crannies of Ruby.

David Black spends much of the book covering Ruby internals to give you a better feel and understanding for the structure of Rails, Ruby, and their numerous idioms. In the end, everything is brought together in a sample iteration of a Rails app, where many of the customizations all of the sudden make much more sense.

The book is worth every penny, and even more importantly, it is worth your time if you're serious about Ruby, Rails, or both. Highly recommended.

2 stars Was not impressed

2006-11-15     2 of 9 found this review helpful

I was not impressed with this book. It's worth reading only because there are so few Ruby on Rails books. There is too much basic Ruby and not enough Rails in this book. I much prefered the Agile Web Dev with Rails.

5 stars highly recommended

2006-05-25     2 of 2 found this review helpful

I found this book to be both thorough and insightful. The examples were clear and useful. I found that it answered a lot of questions I had about Ruby and cleared up several areas where I was hazy (such as Ruby's symbols).

It is geared toward helping programmers understand the Ruby behind Ruby on Rails, but also explains Ruby in general well.

If you want a reference book, the pickaxe would probably serve you better, but as an instructional book it excellent.

5 stars A great book about a great language

2006-05-24     2 of 2 found this review helpful

David Black has put together the book for Rails developers, (In fact it's one of the books that every Ruby developer ought to have as well.)

He takes a wonderful approach to building up the readers understanding of the language a bit at a time, Leaving the Rails (or the Ruby) developer much stronger than she was before she picked up this book.

I started reading it under the Manning Early Access Program, and absolutely fell in love with it before the book was even completed. I heartily recommend it to anyone wanting to work with Ruby or Ruby on Rails.

1 stars Very weak

2008-01-08     1 of 8 found this review helpful

This is primarily a book about Ruby, very little Rails content, and certainly nothing at a deep-dive level about Rails.

5 stars Solid explanations of important concepts

2008-01-05     1 of 1 found this review helpful

There are some core books one should have when working with Ruby and Rails. This is one of them. Many reviews have already been written about this book, some good, some not so good. Regardless, I won't rehash what they said. The two cents I'm throwing in is this: I like the way David explains things. It gives you a better understanding of the topic, and the more you *understand*, the less you have to remember.

1 stars Disappointed...

2007-11-20     1 of 12 found this review helpful

I am new to rails. Before we can do any exercises or practices that come with the book we need to setup the environment correctly. There is no help for this part but instead the author asks you to search the answer on the internet. I read many technical books before but this is the first time I get very frustrated only at chapter 2.

5 stars Very valuable book - takes away the "black magic" feeling

2007-03-12     1 of 2 found this review helpful

This is a book that I highly recommend to anyone wanting to do non-trivial projects with Rails that don't already know ruby in depth.

I read Ruby for Rails while reading "Agile Web Development with Rails" and finding that I couldn't understand what things like "belongs_to :a_model" were actually doing - apparently a common reaction to Rails. The latter parts of that book explain things well, but naturally assume a well developed understanding of core Ruby. I didn't have that so read Ruby for Rails and found things falling into place; sufficiently to find the Rails source code is now quite a pleasant read.

If you plan to do any non-trivial projects with Rails, you will need as deep an understanding of Ruby as possible - this book is a great place to start.

5 stars Saved by this book

2007-02-09     1 of 1 found this review helpful

So I decided to do an independent study on application development with Ruby on Rails...only to find that my Java experience was, if anything, holding me back. After getting several books I finally stumbled upon this one and just sat down and read through over two days.

This may be one of the best Rails books out there if you know a little Ruby and even less Rails. It actually helps you understand what's happening, unlike many other books just trying to cash in on the fad.

Simply put -- if I didn't have this book I wouldn't be graduating.

5 stars Opened my eyes to the possibilities of Ruby

2007-01-24     1 of 1 found this review helpful

I got into Rails after seeing the famous 15 minute Blog video by DHH. After trying it out on and off for a few months, and reading Agile Web Development with Rails, I was in a position to create fairly simple, but functional Rails sites. Then I went to Rails Conf '06 in Chicago and heard that Ruby for Rails was not only "up to date", but a totally different direction. I got it right after coming home from the conference, and read it through in almost one sitting. I went from a decent Rails coder to a competent Ruby programmer AND a much stronger Rails developer - almost overnight.

This book is not "Rails rails rails" - it is, as the title states, ruby FOR rails. It gives Ruby a treatment that is unique in print. Simultaneously showing its expressive beauty and pragmatic nature.

5 stars Ruby for Rails by David Black

2006-11-16     1 of 1 found this review helpful

I am a hobbiest not a professional programmer/developer. I have dabbled with C++/Java/Javascript/JSP/Apache/Python and having heard some interesting comments about Ruby and Rails I thought I would give it a shot. The book, for my use, is excellent. Well written. No dead chapters. It starts at the shallow end of the pool (intro to Ruby) and builds chapter by chapter to the deep end (Rails). I have nothing with which to compare it.

4 stars Serves its purpose

2006-11-10     1 of 1 found this review helpful

This book is not meant for a programmer who already has knowledge of Java , C++ or any other object oriented programming. However it introduces Rubys object oriented programming in a way I had never seen before.

I had no problems reading the book. Quit well written.

5 stars Great for Learning Ruby

2006-11-07     1 of 1 found this review helpful

I have been a programmer for many years (PHP, Java, VB), but I am new to Rails and Ruby. In my quest to learn Rails, I first read Programming Ruby, then I read Agile Web Development with Rails. I found both books to be good reference works, but I did not learn as much from them as I had hoped I would.

This book, on the other hand, has taught me a great deal about how Ruby works and the conventions that Rails uses to leverage Ruby. While reading this book, I had countless "ah-ha", moments, where concepts that were vauge before suddenly "clicked". I highly recommend this book.

3 stars A slow paced, albeit interesting read

2006-07-18     1 of 5 found this review helpful

I found this book to be rather slow paced and not super rich in actual content. The information conveyed is often not that interesting, or simply self-evident. Nevertheless the book does have some bits and pieces that are interesting, perhaps as a side read to Programming Ruby book, or the Rails Agile Web Development book. I feel that for a daily ruby programmer this book is somewhat extracurricular. And as such it mostly succeeds.

3 stars More Ruby Less Rails

2008-01-14     0 of 1 found this review helpful

Another review for this book uses the perfect word: Wordy!

The book reads like it was written for, either somebody completely new to programming, or somebody who can't read. My gripe isn't so much the content, but how it is presented. I found myself skipping many paragraphs because the author goes over the same thing multiple times, not trusting that the reader got the point the first time around.

I'd give this book 4 stars if it was half as short, and there's no reason it couldn't be. Why not 5 stars? Because the content is, like other reviews say, primarily centered around Ruby, with too little about Rails to comfortably use 'rails' in the title.

It's a good Beginning-Ruby book, and it has some good info about both Ruby and Rails, but I would have preferred getting a book dedicated specifically to Ruby, and another book dedicated specifically to Rails.

5 stars Excellent Book - Must have to really understand Rails

2007-11-02     0 of 0 found this review helpful

First of all, I have been a computer programmer for 34 years. I really do not like writing code, so I have always been attracted to methodologies and technologies that write code for you or abstract the process to a higher level than writing each and every line of code.

I have been working on Ruby for Rails development in my spare time and realized that what was missing was my understanding of Ruby.

I found this book mentioned in a blog and ordered it.

This is an excellent book. It presents Ruby in a very manner that ties in with the Rails framework. If you are struggling with all of the mysterious Rails syntax, this book will show you why you are struggling.

The PickAxe book is a real reference. This book has very short simple examples of each code concept and from just reading the book, I have gotten a very good view of Rudy.

I would encourage you to read the whole book. Concepts get repeated and built upon in each chapter.

5 stars Truly Ruby for Rails (not just another Rails book)

2007-10-12     0 of 0 found this review helpful

This is almost TWO BOOKS IN ONE.
Stepping from the very basics, this is one of the few books on the subject that first lays the foundation of Ruby as a scripting language.
It is easy to see the benefits of the Rails framework with a working knowledge of the underlying language (Ruby).

5 stars A Must Have and A Must Read

2007-01-26     0 of 0 found this review helpful

David writes so soft and in a way that all experience levels of programmers will find it a great read. We all know that sometimes reading books on programming you feel like the author is in an infinite loop but leaves a lot unsaid. I highly recommend this book and look forward to future books by David A. Black.

5 stars Good read, and useful information

2007-01-05     0 of 1 found this review helpful

This is my first and only Ruby or Rails book, I don't think I'll be needing another. I like the authors writing style, organization and flow.

This book is good for new commers, has useful examples leading to a good understanding of Ruby and Rails.

5 stars Any Rails Developer should start here first

2006-12-25     0 of 0 found this review helpful

I am upto chapter 11 of the book and decided to go ahead and write this review. I believe that any aspiring Rails developer needs to go through this book first to get the most out of the Rails framework. A basic understanding of Ruby language that is geared towards facilitating the learning process for Rails framework is what this book is meant for. And it delivers.

3 stars Extremely Verbose with Very Little Detail

2006-10-06     0 of 0 found this review helpful

The book is divided into four main parts. The first part, which is almost 100 pages, introduces the reader to ruby, rails, and a simple "follow-along" rails app. This part could easily have been reduced to less than 25 pages.

Parts 2 and 3 introduce Ruby further. I was fully expecting to get some real insight into rails via framework dissection, but was left disappointed. However, the 20+ page "Ruby Dynamics" chapter was surprisingly insightful. Coverage of singleton classes and per-object behavior was very good.

Part 4 expanded the rails app introduced in part 1. There were a few cool tricks, like complex array sorting and dynamically constructing method names to be called by the send instance method. This part did show off some rubyisms, but again, lacked in the rails arena. For instance, simple things like flash are not introduced. Instead an ad-hoc error handler was created (poor use of the framework features). The author mentions several times throughout the book to explore things on your own; for example, forms and form helpers, and ActiveSupport. There were many times the author could have briefly explained something or used a diagram, but copped out.

Bottom line: The author has a very ineffective technical writing style. His ~500 page book could have been condensed into 250 pages by using concise communications and graphics. If you are looking for a rails book, this one just barely scratches the surface. This title may be helpful if you are just starting out, but you will quickly out grow it.

Suggested reading: You will gain a more comprehensive understanding of ruby and rails with the terse and content-rich "Ruby Cookbook" or "Programming Ruby" (Pick Axe) book accompanied by "Agile Web Development with Rails" (2nd Ed recommended).

Buy it from AmazonNew for $32.81