Absolute path to view partials treated as local
tlhunter opened this issue · comments
Thomas Hunter II commented
I'm passing in an absolute path to a view partial HTML file, but it is being treated as a local path. For example:
var partial_path = '/Users/tlhunter/proj/site/controllers/users/views/function.html';
res.render('layouts/main.html', {
partials: {
body: partial_path
},
title: "Homepage"
});
Errors with the following output:
Error: ENOENT, open '/Users/tlhunter/proj/site/views/Users/tlhunter/proj/site/controllers/users/views/function.html'
I feel that if a view partial's path begins with a /
, it should not be appended to the path where views are usually kept, but should be treated as an absolute path.