“Rails Crash Course” book review
written by craig, 30 November 2014
The ominously titled Rails Crash Course proposes to take you from the basics to shipping your first Rails application — fast. Can it deliver on that promise in 270 pages?
Before we start, note that I have recently worked on a Ruby project but at a very rudimentary level. Other than that, I’m a Rails novice. Crash Course targets developers like me with programming skills in other areas. It won’t teach you how to write code but that’s not the point.
Part One is 85 pages covering the fundamentals of the environment. Chapter one introduces types, variables, structures, control flow and classes in less than 20 pages. This is followed by an introduction to Rails describing concepts such as convention over configuration and gems.
The following chapters introduce Rails Models, Controllers and Views before a surprisingly welcome chapter about deployment which highlights version control with Git and using Heroku as an application hosting platform.
The bulk of the book is contained in part two. Developers are encouraged to build a Tumblr-like social networking application from scratch. Advanced topics are rapidly covered:
- data modeling and the active record and
Exercises such as creating a user model for the application are provided at the end of most chapters. Solutions are proposed and discussed at the end of the book.
That alone would be enough for many readers but the Lewis continues with topics including:
- Test-Driven Development for the models, controllers and application flow
- Security issues such as SQL injection, Cross-Site Scripting (XSS) and Cross-Site Forgery (CSRF) attacks
- Performance considerations including the asset pipeline, pre-compilation, SQL optimisation, pagination and caching
- Debugging and logging
- Web APIs using HTTP, REST and application tokens
- Deployment using Capistrano and the Amazon EC2 platform
These topics are essential for modern development but few books venture so far. Admittedly, each could be be a book in its own right, but the technologies and issues are described well with just enough pragmatic advice to get you started.
The only minor criticism I could make is perhaps the debugging chapter should have appeared earlier in the book. That said, it’s possible to dip in and out of chapters as necessary.
The writing style is informative without becoming dry — even in the more geeky sections. It’s chatty but concise and has been written by a fellow programmer with an aptitude for concise communication.
Crash Course books are difficult to pitch right. Many are too lean and serve only as a basic introduction. Others are too deep and require several days reading before you start. Rails Crash Course strikes a perfect balance and a busy developer will become fluent within days. I wish this book had been available before I started my recent project! Highly recommended.