Permalink
Browse files

ADDED - Support for providing `boot_options` in middlewares

  • Loading branch information...
1 parent 9db79fd commit d3797cebc3282348b7d69aa8c0f39abefa65da5c @glesperance committed Apr 2, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/controller.js
View
@@ -127,6 +127,8 @@ function buildWrapper(controller_info, method_func) {
, oRender = res.render
;
+ res._boot_options || (res._boot_options = {});
+
//check if we have a view & if that we do not have an XHR-Request.
//If the view is missing or if we have an XHR-Request, skip view rendering.
if (!req.xhr && view_file) {
@@ -153,6 +155,8 @@ function buildWrapper(controller_info, method_func) {
res.send = oSend;
+ obj.boot_options = _.extend(res._boot_options, obj.boot_options);
+
res.render(view_file, obj);
};

0 comments on commit d3797ce

Please sign in to comment.