Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Eco template renders integer when using 'end' statement #44

Open
mewdriller opened this issue Apr 5, 2012 · 2 comments
Open

Eco template renders integer when using 'end' statement #44

mewdriller opened this issue Apr 5, 2012 · 2 comments

Comments

@mewdriller
Copy link

I have a pretty simple Backbone View that I'd like to have render some blocks of HTML conditionally. I'm seeing a behavior where following the conditionally rendered HTML there is a integer rendered as well. From what I can tell, it seems to happen when I use the end statement to terminate a conditional block.

Here's some code that is demonstrating the error for me:

<% if true: %>Hello World!<% end %>

I would expect this to renderHello World! into the containing element. However, it's actually rendering Hello World!2.

If I add several of blocks in the same template:

<% if true: %>Foo, <% end %>
<% if true: %>Bar, <% end %>
<% if true: %>Baz<% end %>

I would expect this to render Foo, Bar, Baz into the containing element. However, it's actually rendering Foo, 2 Bar, 5 Baz8. After running a somewhat larger set of them, it seems the integer being printed goes up by 3 every time. From reading over the gem's README I can't see anything I'm doing wrong.

Any help would be much appreciated!

@mewdriller
Copy link
Author

@bdillahu
Copy link

bdillahu commented Apr 9, 2014

I'm getting this also... from the age, I guess we're not looking at a fix.

And just as a follow-up, I found I had <%= if.... - removing the "=" got rid of the integer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants