Growing Large Rails Applications
"How did our Rails app get to be such a confusing mess?"
Your models are bloated
When you open up a model file, you see a grab bag of random stuff. There are five methods that relate to this concept, two methods that relate to that concept, and about 20 one-off methods that don't have anything to do with anything else. The problem is especially bad in one or two "god objects" that you can't seem to figure out any way to break up.Your controllers are confusing
Your controllers are bloated, but in a different way. By necessity, you've added custom methods to some of your controllers beyond the defaults that Rails gives you. In some cases you've added quite a lot of custom methods. You want to practice "fat models, skinny controllers" but somehow the controllers are still left carrying a lot of weight.Your views are messy
You know that view code should be kept as simple as possible. Yet there's still some code that doesn't seem to fit comfortably in the view layer, nor the controller model layers, nor anywhere else. You've tried using helpers, and that helps some, but it also creates a mess of its own.Your app generally lacks structure
Your Rails app feels like an amorphous blob, a heap of parts. You easily can't find what you want when you want to find it. When you add new code, it's unclear where to put it, so you just add it to one of the growing piles that are lying everywhere. Your team has tried to fix the problem by adding anapp/services
directory, and that helps a little, but mostly it just moves the mess around.
What would it be like to have a more maintainable Rails application?
Small, easily understandable models
Each model file represents exactly one concept. When you open a model file, you no longer see a sea of code.Tidy controllers
Almost all your controllers have just the seven RESTful actions that they come with by default. All your controllers are small and easy to understand.Clean views
Your views are simple and have very few moving parts. All your complex view-related logic lives in a comfortable home where it's not imposing on anything else.Understandable structure
When you want to find a piece of code, you know where to look. When you need to add a new piece of code, it's clear where to put it.You'll find the solutions to your Rails organization problems in Growing Large Rails Applications.
Introducing: Growing Large Rails Applications
60 Pages, E-book Format

Discover helpful approaches for:
- Keeping models and controllers small and understandable
- The role of ViewComponents
- Using namespaces for modular design
- Keeping JavaScript organized
- Using concerns intelligently
- The use case for service objects
- Much more
What's in the book
- Models
- What a model is, how to structure them, where to put them, how to keep them small and understandable.
- Controllers
- How to avoid bloated, confusing controllers.
- Namespaces
- How to use namespaces to aid in code organization.
- ViewComponents
- What ViewComponents are and how they can help keep code organized.
- Concerns
- When to use concerns and when not to.
- Background jobs
- What to put in background jobs and what not to.
- Service objects
- What service objects are, when to use them, when not to use them.
Purchase Growing Large Rails Applications
Choose a package below to get instant access to Growing Large Rails Applications.
Team Package
Book + Slack Access (for Businesses)
- Growing Large Rails Applications ebook
- Code with Jason Slack access - chat with other Rails devs
- Up to 10 developers may access the material
- Custom invoicing for your financial records
Professional Package
Book + Slack Access (for Individuals)
- Growing Large Rails Applications ebook
- Code with Jason Slack access - chat with other Rails devs
- Custom invoicing for your financial records
- Up to 10 developers may access the material
Basic Package
Book + Slack Access
- Growing Large Rails Applications ebook
- Code with Jason Slack access - chat with other Rails devs
- Up to 10 developers may access the material
- Custom invoicing for your financial records
FAQs
How long is the book?
The book is 60 pages long.What's the format of the book?
When you purchase, you get a zip file containing PDF, EPUB and MOBI formats. No print version as of now.When was the book last updated?
The book was last updated in November of 2022.What if I buy it and I don’t like it? Do I get my money back?
Yes. I offer a 100% no-questions-asked money-back guarantee.About the Author

I'm Jason Swett. I'm a developer, speaker, trainer, author and host of The Code with Jason Podcast.
I've taught programming classes and given tech talks all over the US and the world, including conferences like RailsConf, RubyConf, RubyConf India and RubyHACK. My corporate teaching clients have included Deloitte, VMware, Liberty Mutual and HP.
I've spoken or taught in the US, India, Nigeria, Bulgaria and the Netherlands.