What are some best practices around an aggregate page in Rails/Ruby webapps? By an aggregate page, I mean a page in an application that displays data from several different models and has functionality for operating on some of those models.
I’m currently working in a Padrino app and we have some “dashboard” views that aggregate data and functionality for several different models but itself has no model. Our current “dashboard” controller is accessing each of the models independently and storing each result its own instance variable (almost 20) for the view to render. You should probably know too that all of the data is coming from a web API, not from our app database.
I suspect that this is less than the best approach. What are better approaches for these types of situations? Should we introduce a
dashboard model that aggregates the data so the controller only instantiates that object?
Any advice you can offer is greatly appreciated.