Skip to content

Instantly share code, notes, and snippets.

@Dglgmut
Created January 26, 2012 16:00
Show Gist options
  • Save Dglgmut/1683480 to your computer and use it in GitHub Desktop.
Save Dglgmut/1683480 to your computer and use it in GitHub Desktop.
Weird exception on Execjs with the 'for' operator, but everything works fine if I use another operator.
<h1>Listing Posts</h1>
<% for post in @posts: %>
<div class="item" data-id="<%= post.id %>">
<a data-type="show"><%= post.title %></a>
<a data-type="edit">Edit</a>
<a data-type="destroy">Destroy</a>
</div>
<% end %>
<p><a data-type="new">New Post</a></p>
# Throws;
# Error: Parse error on line 2: Unexpected 'INDENT'
# (in C:/lab/jrails/blog/app/assets/javascripts/app/views/posts/index.jst.eco)
<h1>Listing Posts</h1>
<% if @posts.length: %> # << no exception
#everything works fine
<% end %>
<p><a data-type="new">New Post</a></p>
#everything works fine
@bigfive
Copy link

bigfive commented Apr 6, 2012

Did you manage to fix this?

@Dglgmut
Copy link
Author

Dglgmut commented Apr 7, 2012

@bigfive no, I guess it was an issue with jruby at windows, because it worked fine at ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment