Permalink
Browse files

Definition of custom view scripts

I was able to found that only by searching the sources:
https://github.com/balderdashy/sails/blob/master/lib/hooks/views/index.js

/**
		 * res.view([specifiedPath|locals], [locals])
		 *
		 * @param {String} specifiedPath
		 *				-> path to the view file to load (minus the file extension)
		 *					relative to the app's `views` directory
		 * @param {Object} locals
		 *				-> view locals (data that is accessible in the view template)
		 * @param {Function} cb_view(err)
		 *				-> called when the view rendering is complete (response is already sent, or in the process)
		 *					(probably should be @api private)
		 * @api public
		 */
  • Loading branch information...
1 parent b328056 commit bc16616ada6ff985a23ae47c16ba4fa99f596caa @Voronchuk Voronchuk committed Oct 11, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 views.md
View
@@ -124,6 +124,11 @@ Now, lets include it from our home page (we'll use the relative path to our part
```
+## FAQ
+> __How can I define custom view path from controller (not from router)?__
+> ```res.view('path/relative/to/views/folder', localsObject);```
+
+

0 comments on commit bc16616

Please sign in to comment.