Reputation: 2965
I'm new to Rails and MVC in general. I have a view (a dashboard) that displays different counts, statistics, calculations and lists. The data comes from many different tables, how do I handle this in Rails and stay with the MVC pattern? I don't have a 'dashboard' model.
Upvotes: 0
Views: 382
Reputation: 32748
Not every view is required to be paired with one model. In fact there is no such "requirement" that a view needs to be associated with any model at all.
In every one of my apps I have multiple pieces of data from multiple models I am displaying and its quite rare for any single view to only refer to any single instance variable.
Any instance variable you set in the controller will be made available in your view.
Thats it!
Upvotes: 1