victormejia
victormejia

Reputation: 1184

include variable in partial include string in harp/ejs

I'm trying to build a dynamic string that will then include a partial. Essentially, I would like to do something like this:

<%= partial("questions/<%= filename %>") %>

but that isn't working. Any tips on how do to this?

Upvotes: 1

Views: 393

Answers (1)

victormejia
victormejia

Reputation: 1184

It was simple string concat!

<%= partial("questions/" + filename) %>

Thanks to Mike McNiel (creator of Sails.js) for answering this on Twitter.

Upvotes: 0

Related Questions