News for hackers. Stuff that matters.
Re:On logic in a Rails app, revisited 6 years later by revskill on Saturday May 18, 2019 @08:04PM (#19950463)
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.

Re:On logic in a Rails app, revisited 6 years later by conanbatt on Saturday May 18, 2019 @09:14PM (#19950745)
Long term controllers being fat will give you headaches if you want to provide an api for different platforms (mobile, another web)
Re:On logic in a Rails app, revisited 6 years later by drizze on Saturday May 18, 2019 @08:08PM (#19950484)
But 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”

Re:On logic in a Rails app, revisited 6 years later by revskill on Saturday May 18, 2019 @10:40PM (#19951105)
If "Rails it not your application", why use Rails then ?
Re:On logic in a Rails app, revisited 6 years later by joevandyk on Sunday May 19, 2019 @01:02AM (#19951545)
It’s a set of libraries that work great together, it’s pretty easy to learn, and lots of people know Rails.