ejs icon indicating copy to clipboard operation
ejs copied to clipboard

Support for Express 'view engine' extension setting in 'include' statement

Open melnaron opened this issue 12 years ago • 6 comments

Hello, I found and fixed next problem with 'include' statement: when I set 'view engine' setting via Express (app.set('view engine', 'html') for example) I can put filepath of the view in the 'res.render' function without extension, but when I want put filepath without extension in 'include' statement in view it will cause an error, because default extension for included files is only '.ejs'. I fixed this issue by adding support for extension from 'view engine' option when it set.

melnaron avatar Jan 14 '13 03:01 melnaron

+1

jeromegn avatar Jan 16 '13 04:01 jeromegn

+1

JonnyBGod avatar Mar 22 '13 00:03 JonnyBGod

+1

JoeDoyle23 avatar May 08 '13 15:05 JoeDoyle23

good job!

sumory avatar May 08 '13 16:05 sumory

I was wondering why this wasn't already the case, was about to write this up myself and submit a pull request when I saw that this one was here from so long ago. Is there a reason this can't be pulled in? Is there any disadvantage or reason I shouldn't do something similar to this if I want to use the .html extension?

CoryG89 avatar Jun 24 '13 20:06 CoryG89

@CoryG89, I have same questions! Can someone merge it?

melnaron avatar Jun 25 '13 06:06 melnaron