You are previewing Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring.

Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring

Cover of Rails™ AntiPatterns: Best Practice Ruby on Rails™ Refactoring by Tammer Saleh... Published by Addison-Wesley Professional
O'Reilly logo

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 ...

The best content for your career. Discover unlimited learning on demand for around $1/day.