“Objects on Rails” by Avdi Grimm is free to read online. Familiarity with Rails and Ruby is assumed.
This is the complete text of Objects on Rails, a “developer’s notebook” documenting some guidelines, techniques, and ideas for applying classic object-oriented thought to Ruby on Rails applications. This book is aimed at the working Rails developer who is looking to grow and evolve Rails projects while keeping them flexible, maintainable, and robust. The focus is on pragmatic solutions which tread a “middle way” between the expedience of the Rails “golden path”, and rigid OO purity.
Table of Contents
- Yet another frickin’ blog app
- Adding blog entries
- Submitting posts
- Getting the tests running again
- Adding timestamps
- OMG Dependency Injection!
- Sorting and limiting posts
- Adding validation
- Introducing the Exhibit Pattern
- Making the data stick around
- Concealing ActiveRecord behind a FigLeaf
- Default content
- Exhibits for REST
- Adding tags
- Respecting controller privacy
- Jealously guarding collections
- Toward self-rendering objects
Link: Read online.