Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In HAML, how to write comments in :javascript region so that comments do not show to the public?

in HAML, we can write comments using

-# some comment and it won't become HTML and made public

but if it is inside

:javascript
  -# comments like this line will break the javascript interpreter as it becomes javascript code
  // so we are forced to use comment like this and is publicly viewable

is there a way to make it non-public?

like image 886
nonopolarity Avatar asked Jun 03 '10 22:06

nonopolarity


1 Answers

#{}- blocks are evaluated, so you can write

#{ # this is a ruby comment, but still a comment (newline is required)
}
like image 65
Vasfed Avatar answered Nov 15 '22 15:11

Vasfed