How should I implement the business logic layer in Rails? And where should I put this code?

I read "Enterprise Rails" (http://oreilly.com/catalog/9780596515201). The author suggests having two subfolders, called logical, physical in the model folder. It is a good idea to organize the code. It will also allow you to create a business layer. I just want to know how the rail community talks about this. Is it a good idea to have a separate logic level?

+3
source share
1 answer

Sometimes I use a “service” layer along the model and controllers.

I just add it to autoload_path.

But most of the time I manage to establish logic in a stateless model or model. Thus, it goes directly to the model folders.

+1

Source: https://habr.com/ru/post/1784442/


All Articles