rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 97 forks source link

Add filename option to render so templates can have access. #126

Closed n8agrin closed 10 years ago

n8agrin commented 11 years ago

In Sinatra, the file argument passed to a Tilt Template is usually a path to the calling Ruby file, not the name of the template file. This makes it impossible to reuse the filename when outputting the compiled template. For example, when precompiling Handlebars templates it would be nice to be able to automatically namespace them in JavaScript based on their filename. This change adds an option to pass the filename.

j15e commented 10 years ago

Thanks