I looked a little bit more at the rendr source, and one thing that immediately jumps out at me is the code BaseView#getTemplateData[1] which very tightly couples the model & views together.
You should totally steal highbrow's ViewModel code, which is very sweet. (But you might want to come up with a better name). Rather than passing @model.toJSON() as template data, highbrow creates a ViewModel from the model or collection or out of thin air, and passes that in as template data.
This shows the main two features of ViewModel's: a whitelist of attrs that the template can access directly, and a set of functions that would otherwise end up polluting your model with view side code.
This decoupling dramatically improves the structure of our applications, without introducing Rails style controllers which are also totally misnamed in my opinion. Rails controllers are essentially two things: routers and MV-shims. Splitting the two makes for much improved program structure.
Here's a typical ViewModel definition (in JS):
This shows the main two features of ViewModel's: a whitelist of attrs that the template can access directly, and a set of functions that would otherwise end up polluting your model with view side code.This decoupling dramatically improves the structure of our applications, without introducing Rails style controllers which are also totally misnamed in my opinion. Rails controllers are essentially two things: routers and MV-shims. Splitting the two makes for much improved program structure.
1: https://github.com/airbnb/rendr/blob/master/shared/base/view...
2: https://github.com/wvl/highbrow/blob/master/src/view-model.c...