Skip to content
jarnoux edited this page Jun 23, 2013 · 7 revisions

Views are generated by templates stored in files in the views/ directory. The hb-adapter middleware is the template engine of Rig and it is just a little bit of glue around the very good Handlebars template engine.

Dispatched Views and Controllers

The dispatcher middleware uses the name of the controllers it has to dispatch to find the view in which to insert the controllers results. E.g.

rig.register('controllers.body', require('./controllers/body.js');

In this case the result passed to the done argument of the body controller will be inserted in the template contained in the file at views/body.html See dispatcher for more information on how to configure and describe dispatching.

Clone this wiki locally