kishorenc/road — Issue #4: View callbacks look messy
Author: kishorenc
Created: 2011-11-29 15:57:12+00:00
State: open
Labels: code-cleanup

The `callback` of the controller method is used to render the view. It offers lots of options, but ends up looking unwieldy at times.

Example:

callback(['viewName', {key:'value'}], 'text/plain');

Redesigned callbacks should look like:

callback('viewName', {key: 'value'}, 'text/plain'); // render view with data (optional) and MIME type (optional)
callback('viewName`, 'text/plain'); // render view with just data and MIME type
callback({'text/plain': 'plain text string'}); // render plain text string in custom MIME type