Contents


preface
acknowledgments
about this book
about the authors
about the cover illustration
 
Chapter 1 Ruby on Rails, the framework
What is Ruby on Rails?
Developing your first application
Summary

 
Chapter 2 Testing saves your bacon
Test- and behavior-driven development
Test-driven development
Behavior-driven development
Summary

 
Chapter 3 Developing a real Rails application
Application setup
First steps
Summary

 
Chapter 4 Oh CRUD!
Viewing projects
Editing projects
Deleting projects
Summary

 
Chapter 5 Nested resources
Creating tickets
Viewing tickets
Editing tickets
Deleting tickets
Summary

 
Chapter 6 Authentication and basic authorization
What Devise does
User signup
Confirmation link sign-in
Form sign-in
Linking tickets to users
Summary

 
Chapter 7 Basic access control
Projects can be created only by admins
Adding the admin field to the users table
Restricting actions to admins only
Namespace routing
Namespace-based CRUD
Creating admin users
Editing users
Deleting users
Summary

 
Chapter 8 More authorization
Restricting read access
Restricting by scope
Fixing what you broke
Blocking access to tickets
Restricting write access
Restricting update access
Restricting delete access
Assigning permissions
Seed data
Summary

 
Chapter 9 File uploading
Attaching a file
Attaching many files
Serving files through a controller
Using JavaScript
Summary

 
Chapter 10 Tracking state
Leaving a comment
Changing a ticket’s state
Tracking changes
Managing states
Locking down states
Summary

 
Chapter 11 Tagging
Creating tags
Adding more tags
Tag restriction
Deleting a tag
Finding tags
Summary

 
Chapter 12 Sending email
Sending ticket notifications
Subscribing to updates
Real-world email
Receiving emails
Summary

 
Chapter 13 Designing an API
The projects API
Beginning the tickets API
Rate limiting
Versioning an API
Summary

 
Chapter 14 Deployment
Server setup
RVM and Ruby
Creating a user for the app
The database server
Deploy away!
Serving requests
Summary
 
 
Chapter 15 Alternative authentication
How OAuth works
Twitter authentication
GitHub authentication
Summary

 
Chapter 16 Basic performance enhancements
Pagination
Database query enhancements
Page and action caching
Background workers
Summary

 
Chapter 17 Engines
A brief history of engines
Why engines are useful
Brand-new engine
Setting up a testing environment
Writing your first engine feature
Adding more posts to topics
Classes outside your control
Releasing as a gem
Integrating with an application
Summary

 
Chapter 18 Rack-based applications
Building Rack applications
Building bigger Rack applications
Mounting a Rack application with Rails
Middleware
Summary

 
appendix A Why Rails?
appendix B Tidbits
index