4 ms·
Sharing business logic between models/controllers/views often leads to a mess. There's a reason to just write business logic code at only ONE place, the contro
by revskill 7y ago
Sharing business logic between models/controllers/views often leads to a mess.
There's a reason to just write business logic code at only ONE place, the controller.
You'll thank yourselves years later when you revisited your code. Just one place to look for.
- drizze 7y agoBut placing logic in the controllers means you need to get a rails controller to test your business logic. This may seem fine in a small application, but as an app grows it becomes a headache to need to tie all your business rules to your framework. “Rails is not your application”
- conanbatt 7y agoLong term controllers being fat will give you headaches if you want to provide an api for different platforms (mobile, another web)