I have a form in Ruby on Rails, that handles creation of a new comment asynchronous.
I use format.js
as a response and my code in the template looks something like this:
create.js.haml
- if (@comment.position)
-# add the comment to the video
-# do smthng
if (window.Test == true){
-# do something else
}
-# do other stuff
The problem is, that I get a Illegal nesting: nesting within plain text is illegal.
Error for the line that contains //do something else
.
I know, I could simply remove the indention of this line, but I want to format my JS code as usual.
Any ideas how I can do this correctly?
Thanks a lot!