O'Reilly logo

Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring by Chad Pytel, Tammer Saleh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Controllers

Controllers put the C in MVC and are a fundamental part of the Rails framework. However, the relationship that many Rails programmers have with controllers is complex.

On one hand, controllers are categorically loathed, with most Rails programmers having the goals that as little code as possible should go into controllers and that controllers should all be pretty much the same auto-generated scaffolding.

On the other hand, there is an intense focus on controllers—so much so that the aforementioned goals have been an immense source of abstraction and innovation in Rails, allowing programmers to write more functionality with less code.

In fact, in the 2.x Rails releases, the most fundamental changes came to controllers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required