View our GitHub

Please visit sails-docs on GitHub to view documentation on your mobile device.

Edit Page

View Engines

The default view engine in Sails is EJS.

Swapping out the view engine

To use a different view engine, you should use npm to install it in your project, then set sails.config.views.engine in config/views.js.

For example, to switch to jade, run npm install jade --save-dev, then set engine: 'jade' in config/views.js.

Supported view engines
Adding new custom view engines

For instructions on adding support for a view engine not listed above, check out the consolidate project repository.

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.