Rails 3 in Action
Ryan Bigg and Yehuda Katz
  • September 2011
  • ISBN 9781935182276
  • 592 pages

Takes you on an excellent Rails 3 adventure!

Anthony J. Topper, Penn State Harrisburg


Rails 4 in Action is now available. An eBook of this older edition is included at no additional cost when you buy the revised edition!

A limited number of pBook copies of this edition are still available. Please contact Manning Support to inquire about purchasing previous edition copies.

Rails 3 in Action is a collaboration between Rails community leaders Ryan Bigg and Yehuda Katz that covers Rails 3.1 so it's the most up-to-date resource available. But it's much more than just a Rails 3 reference book. You'll learn to do Rails the right way so you can build stable, scalable, and maintainable apps that will satisfy even the most demanding clients.

About the book

Rails 3 is a full stack, open source web framework powered by Ruby and this book is an introduction to it. Whether you're just starting or you have a few cycles under your belt, you'll appreciate the book's guru's-eye-view of idiomatic Rails programming.

You'll master Rails 3.1 by developing a ticket tracking application that includes RESTful routing, authentication and authorization, state maintenance, file uploads, email, and more. You'll also explore powerful features like designing your own APIs and building a Rails engine. You will see Test Driven Development and Behavior Driven Development in action throughout the book, just like you would in a top Rails shop.

Table of Contents detailed table of contents



about this book

about the authors

about the cover illustration

1. Ruby on Rails, the framework

1.1. What is Ruby on Rails?

1.2. Developing your first application

1.3. Summary

2. Testing saves your bacon

2.1. Test- and behavior-driven development

2.2. Test-driven development

2.3. Behavior-driven development

2.4. Summary

3. Developing a real Rails application

3.1. Application setup

3.2. First steps

3.3. Summary

4. Oh CRUD!

4.1. Viewing projects

4.2. Editing projects

4.3. Deleting projects

4.4. Summary

5. Nested resources

5.1. Creating tickets

5.2. Viewing tickets

5.3. Editing tickets

5.4. Deleting tickets

5.5. Summary

6. Authentication and basic authorization

6.1. What Devise does

6.2. User signup

6.4. Form sign-in

6.5. Linking tickets to users

6.6. Summary

7. Basic access control

7.1. Projects can be created only by admins

7.2. Adding the admin field to the users table

7.3. Restricting actions to admins only

7.4. Namespace routing

7.5. Namespace-based CRUD

7.6. Creating admin users

7.7. Editing users

7.8. Deleting users

7.9. Summary

8. More authorization

8.1. Restricting read access

8.2. Restricting by scope

8.3. Fixing what you broke

8.4. Blocking access to tickets

8.5. Restricting write access

8.6. Restricting update access

8.7. Restricting delete access

8.8. Assigning permissions

8.9. Seed data

8.10. Summary

9. File uploading

9.1. Attaching a file

9.2. Attaching many files

9.3. Serving files through a controller

9.4. Using JavaScript

9.5. Summary

10. Tracking state

10.1. Leaving a comment

10.2. Changing a ticket’s state

10.3. Tracking changes

10.4. Managing states

10.5. Locking down states

10.6. Summary

11. Tagging

11.1. Creating tags

11.2. Adding more tags

11.3. Tag restriction

11.4. Deleting a tag

11.5. Finding tags

11.6. Summary

12. Sending email

12.1. Sending ticket notifications

12.2. Subscribing to updates

12.3. Real-world email

12.4. Receiving emails

12.5. Summary

13. Designing an API

13.1. The projects API

13.2. Beginning the tickets API

13.3. Rate limiting

13.4. Versioning an API

13.5. Summary

14. Deployment

14.1. Server setup

14.2. RVM and Ruby

14.3. Creating a user for the app

14.4. The database server

14.5. Deploy away!

14.6. Serving requests

14.7. Summary

15. Alternative authentication

15.1. How OAuth works

15.2. Twitter authentication

15.3. GitHub authentication

15.4. Summary

16. Basic performance enhancements

16.1. Pagination

16.2. Database query enhancements

16.3. Page and action caching

16.4. Background workers

16.5. Summary

17. Engines

17.1. A brief history of engines

17.2. Why engines are useful

17.3. Brand-new engine

17.4. Setting up a testing environment

17.5. Writing your first engine feature

17.7. Classes outside your control

17.8. Releasing as a gem

17.9. Integrating with an application

17.10. Summary

18. Rack-based applications

18.1. Building Rack applications

18.2. Building bigger Rack applications

18.3. Mounting a Rack application with Rails

18.4. Middleware

18.5. Summary

Appendix A: Why Rails?

Appendix B: Tidbits


What's inside

  • Covers Rails 3.1 from the ground up
  • Testing and BDD using RSpec and Cucumber
  • Working with Rack

About the reader

It is helpful for readers to have a background in Ruby, but no prior Rails experience is needed.

About the author

Ryan Bigg is a Rails developer in Sydney, recognized for his prolific and accurate answers on IRC and StackOverflow. Yehuda Katz is a lead developer on SproutCore, known for his contributions to Rails 3, jQuery, Bundler, and Merb.

placing your order...

Don't refresh or navigate away from the page.

FREE domestic shipping on three or more pBooks