Eco (Embedded Coffee Script) Error – Unexpected dedent
- January 29th, 2012
- Posted in Javascript
- Write comment
Ran into this error when testing out eco (Embedded Coffee Script) templates.
Parse error on line #: unexpected dedent
(in c:/project/app/assets/javascripts/backbone/templates/dartboard.jst.eco)
Broken code:
<% if 7 > 3 %> teststring <% end %>
Fixed Code:
<% if 7 > 3: %> teststring <% end %>
Notice the colon, this is telling coffeescript that the next line is indented. It’s document here: https://github.com/sstephenson/eco it had just slipped my mind.
Ry
Thank You!