mauricemach / coffeekup

Markup as CoffeeScript.
coffeekup.org
MIT License
1.26k stars 84 forks source link

Dynamic view helpers from express #60

Closed randallb closed 13 years ago

randallb commented 13 years ago

Because of the eval-ing going on, I don't think dynamic view helpers can access stuff they'd normally be able to access, preventing me from using the default CSRF express tools w/ Coffeekup.

I'm going to probably write my own middleware as a result.

mauricemach commented 13 years ago

You mean https://github.com/hanssonlarsson/express-csrf? I couldn't get it working with their readme example + jade (got "Unexpected identifier"). Can you point me to a working sample?

I also ran a little dynamic helpers test with CoffeeKup and they seem to be working fine. I can't think of why they shouldn't. The only "eval-ing" going on in CoffeeKup is at the time of compiling the template (use of the Function constructor), which since express started expecting a .compile method, I believe is the case with most templating engines.

If you could post a gist with an express app similar to yours, using a dynamic helper, working with another templating engine, but choking with CK, that would help a lot.

randallb commented 13 years ago

I'm going to close this for now... I expect to try dynamic view helpers in a day or two.

mauricemach commented 13 years ago

ok!