Open dnagir opened 13 years ago
the undefined() is a bug and will be fixed (probably later tonight.) -- it will instead output the html escaping function, by default html_escape().
Can I ask why you are using Haml.compile instead of Haml() ? The latter returns the executable function, with the appropriate with(locals){...}
.
Thanks!
Ok. Thanks for the upcoming fix to this.
I was using compile
to see what gets generated to understand better how haml-js works.
But I might also use compile
to generate JS code on the server
Currently I am using Haml(".content")
then execute toString()
. And then strip out the function name.
This seems to be a bit crazy to do.
Additionally I don't like that Haml
function wraps the template code in catch
block. I would rather prefer to see where exactly the error happened instead of silently rendering the default error template.
So how do you generate (or not)
selected
attribute with HAML similar to this:#something{selected: visible}
When I do:
Haml.compile('#something{selected: visible}')
I get the code generated:
This includes
undefined(visible)
which is invalid JavaScript. Am I doing something wrong here?