Clone this wiki locally
ViewModels for Rails
A view model/representer solution for Rails.
- Polymorph view model objects that correspond to model objects.
- View model specific templates.
- Hierarchical Template Rendering: Allows generalized templates for a class tree of view models.
- Helper methods directly on the view models.
- No view related code in the models.
- A clean API for use in Rails.
- 100% rcov coverage, nice metrics, gallons of blood and sweat by excellent contributors.
florian • hanke at gmail • com if you have questions/feedback, thanks! :)
Fork if you have improvements. Send me a pull request, it is much appreciated.
Display Methods are not well placed either in
- models: Violation of the MVC principle.
- helpers: No Polymorphism.
A thin proxy layer over a model, with access to the controller, used by the view or controller.
The view → to
the view model which in turn →
the model and →