Home > Store > Programming > Ruby

larger cover

Add To My Wish List

Ruby on Rails Tutorial: Learn Web Development with Rails, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

  • Description
  • Downloads
  • Extras
  • Reviews
  • Sample Content

Product Author Bios

Michael Hartl is the author of the Ruby on Rails™ Tutorial, the leading introduction to web development with Ruby on Rails. His prior experience includes writing and developing RailsSpace, an extremely obsolete Rails tutorial book, and developing Insoshi, a once-popular and now-obsolete social networking platform in Ruby on Rails. In 2011, Michael received a Ruby Hero Award for his contributions to the Ruby community. He is a graduate of Harvard College, has a Ph.D. in Physics from Caltech, and is an alumnus of the Y Combinator entrepreneur program.

Ruby on Rails™ Tutorial by Michael Hartl has become a must-read for developers learning how to build Rails apps.”

Peter Cooper, Editor of Ruby Inside

 

Using Rails, developers can build web applications of exceptional elegance and power. Although its remarkable capabilities have made Ruby on Rails one of the world’s most popular web development frameworks, it can be challenging to learn and use. Ruby on Rails™ Tutorial, Second Edition, is the solution. Best-selling author and leading Rails developer Michael Hartl teaches Rails by guiding you through the development of your own complete sample application using the latest techniques in Rails web development. The updates to this edition include all-new site design using Twitter’s Bootstrap; coverage of the new asset pipeline, including Sprockets and Sass; behavior-driven development (BDD) with Capybara and RSpec; better automated testing with Guard and Spork; roll your own authentication with has_secure_password; and an introduction to Gherkin and Cucumber.

 

You’ll find integrated tutorials not only for Rails, but also for the essential Ruby, HTML, CSS, JavaScript, and SQL skills you’ll need when developing web applications. Hartl explains how each new technique solves a real-world problem, and he demonstrates this with bite-sized code that’s simple enough to understand, yet novel enough to be useful. Whatever your previous web development experience, this book will guide you to true Rails mastery.

 

This book will help you

  • Install and set up your Rails development environment
  • Go beyond generated code to truly understand how to build Rails applications from scratch
  • Learn test-driven development (TDD) with RSpec
  • Effectively use the Model-View-Controller (MVC) pattern
  • Structure applications using the REST architecture
  • Build static pages and transform them into dynamic ones
  • Master the Ruby programming skills all Rails developers need
  • Define high-quality site layouts and data models
  • Implement registration and authentication systems, including validation and secure passwords
  • Update, display, and delete users
  • Add social features and microblogging, including an introduction to Ajax
  • Record version changes with Git and share code at GitHub
  • Simplify application deployment with Heroku

Downloads

Please download free additional content here

Customer Reviews

14 of 14 people found the following review helpful
5.0 out of 5 stars Best tech book I've ever read, August 13, 2012
Amazon Verified Purchase(What's this?)
This review is from: Ruby on Rails Tutorial: Learn Web Development with Rails (2nd Edition) (Addison-Wesley Professional Ruby Series) (Paperback)
Not only is this the best Rails book on the market, it is the best tech book I've ever read! Michael Hartl is a great teacher. You won't be disappointed.

Also - most, if not all of the 1 star reviews you see are due to the printing error of the book. It is due to the publisher, and out of Michael's hands.

What are you waiting for ? Grab yourself a copy, and thank me later :)

Update Dec 10, 2012: I just wanted to pop in and say that the learning experience produced some fruitful results. After learning Rails from this book, I created an internal website as part of my job and received a lot of praise. I love Rails now, and I really hope Michael comes out with an "Advanced Rails" book. I'd be one of the first in line to grab it.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


10 of 10 people found the following review helpful
5.0 out of 5 stars Extremely well written, great for beginner, November 1, 2012
Amazon Verified Purchase(What's this?)
This review is from: Ruby on Rails Tutorial: Learn Web Development with Rails (2nd Edition) (Addison-Wesley Professional Ruby Series) (Paperback)
I have never before worked my way through a tutorial in which EVERYTHING happens exactly the way the author says it will, but that's how this book has gone thus far (I'm about 1/3 through). I am new to web development and database development, and I really appreciate the step-by-step approach. The first chapter is a masterpiece, taking you from installation on your PC, to deployment on a "real" server, and even teaching you to use github along the way. I've never said, "OMG, it actually WORKED!" so many times in a single evening. Highly recommended.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


3 of 3 people found the following review helpful
5.0 out of 5 stars Printing Error was corrected, August 11, 2012
This review is from: Ruby on Rails Tutorial: Learn Web Development with Rails (2nd Edition) (Addison-Wesley Professional Ruby Series) (Paperback)
[Update 10.9.12]

I originally posted this review when I received the first physical printing of the book which had a critical printing error (detailed below). I am assured that the new printing of the book has none of these errors.

After returning the incorrectly printed book I purchased a digital copy instead. Based on the content of the digital copy I have changed my review to 5 stars. Though I have not made my way through much of the book at this point, so far I have successfully deployed the first two sample rails applications to Heroku. I've come across no problems with the book content and any errors I've run across in my own system configuration have been related to linux configuration and have been preempted by instructions in the book.

Great book so far and I'm enjoying working my way through.

[Original Review]

While waiting for the book edition to come out I had been browsing my way through the online version of this... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 43 customer reviews...

Online Sample Chapter

Ruby on Rails Tutorial: From Zero to Deploy

Table of Contents

Foreword to the First Edition by Derek Sivers xv

Foreword to the First Edition by Obie Fernandez xvii

Acknowledgments xix

About the Author xxi

 

Chapter 1: From Zero to Deploy 1

1.1 Introduction 3

1.2 Up and Running 9

1.3 Version Control with Git 27

1.4 Deploying 39

1.5 Conclusion 43

 

Chapter 2: A Demo App 45

2.1 Planning the Application 45

2.2 The Users Resource 49

2.3 The Microposts Resource 63

2.4 Conclusion 74

 

Chapter 3: Mostly Static Pages 77

3.1 Static Pages 82

3.2 Our First Tests 93

3.3 Slightly Dynamic Pages 103

3.4 Conclusion 114

3.5 Exercises 114

3.6 Advanced Setup 117

 

Chapter 4: Rails-Flavored Ruby 129

4.1 Motivation 129

4.2 Strings and Methods 134

4.3 Other Data Structures 142

4.4 Ruby Classes 153

4.5 Conclusion 164

4.6 Exercises 164

 

Chapter 5: Filling in the Layout 167

5.1 Adding Some Structure 167

5.2 Sass and the Asset Pipeline 187

5.3 Layout Links 197

5.4 User Signup: A First Step 211

5.5 Conclusion 215

5.6 Exercises 217

 

Chapter 6: Modeling Users 221

6.1 User Model 222

6.2 User Validations 236

6.3 Adding a Secure Password 254

6.4 Conclusion 267

6.5 Exercises 268

 

Chapter 7: Sign Up 271

7.1 Showing Users 271

7.2 Signup Form 292

7.3 Signup Failure 303

7.4 Signup Success 312

7.5 Conclusion 321

7.6 Exercises 321

 

Chapter 8: Sign In, Sign Out 325

8.1 Sessions and Signin Failure 325

8.2 Signin Success 343

8.3 Introduction to Cucumber (Optional) 363

8.4 Conclusion 371

8.5 Exercises 372

 

Chapter 9: Updating, Showing, and Deleting Users 373

9.1 Updating Users 373

9.2 Authorization 385

9.3 Showing All Users 396

9.4 Deleting Users 413

9.5 Conclusion 422

9.6 Exercises 424

 

Chapter 10: User Microposts 429

10.1 A Micropost Model 429

10.2 Showing Microposts 445

10.3 Manipulating Microposts 454

10.4 Conclusion 479

10.5 Exercises 480

 

Chapter 11: Following Users 483

11.1 The Relationship Model 484

11.2 A Web Interface for Following Users 503

11.3 The Status Feed 529

11.4 Conclusion 539

11.5 Exercises 543

 

Index 545

Appendix

Download the sample pages (includes Chapter 1 and Index)

Sample Pages

Download the sample pages (includes Chapter 1 and Index)

 
Best Value

Book + eBook Bundle  $80.98  $48.59

Book Price $35.99
eBook Price $12.60
eBook formats included

Buy

This book is temporarily out of stock, but will ship for free when in stock.

Buy

Book  $44.99  $35.99

We're temporarily out of stock, but order now and we'll send it to you later.

This book is temporarily out of stock, but will ship for free when in stock.

Buy

eBook (Watermarked)  $35.99  $28.79

Includes EPUB, MOBI, and PDF
About eBook Formats

This eBook includes the following formats, accessible from your Account page after purchase:

ePubEPUBThe open industry format known for its reflowable content and usability on supported mobile devices.

MOBIMOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.

Adobe ReaderPDFThe popular standard, used most often with the free Adobe® Reader® software.

This eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.

Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.