I have an application built using MVC that creates a view that provides summary information for several models. In addition, some calculations are performed on different data sets.
There is no clear unified model (which, at least, compares with the table), which, apparently, makes sense as a starting point for this, therefore, various resumes are pulled from the providing models in the controller, transferred to the presentation and calculations are performed there.
But it seems, well, dirty. But controllers should be light, right? And business logic should not be in the minds, as I have it as present.
So where should this information be collected? A new model that does not map to a table? Library function / module? Or something else?
(Although I see this as a basic architecture / template issue, I work in Rails, FWIW.)
Change Good answers in everything and a lot of consensus, which is encouraging. I “accepted” the answer I made to keep the link to the Railscasts at the top. I lag behind in my viewing of Railscast - I will do something with explicit attempts to fix it!
source share