News for hackers. Stuff that matters.
Re:On logic in a Rails app, revisited 6 years later by skunkworker on Saturday May 18, 2019 @05:59PM (#19949965)
A number of years ago I started decoupling my business logic from my controllers and models and now use the ActiveInteraction gem. It really makes a difference when you have multiple interfaces that need to deal with a specific action on a specific object without having to call a controller all of the time.

While idiomatic Rails is definitely possible, I've been bitten by coding errors in Models where specific validations are only ran on update and/or create. Now I just run a CreatePerson object which only has the specific functionality needed and is decoupled as much as possible from other sections.

There are no comments on this comment yet.