Search code examples
ruby-on-railsrubytemplatescoffeescripteco

Eco templates - Some artefacts in code


Using eco template I form follow code:

<% if @is_completed : %>
   <span class="label">completed</span>
<% end %>

But after rendering I see some artifacts in my code:

<div class="large-3 columns">
    <span class="label">
        completed
    </span>
    "9"
</div>

p.s.

I've tried to mark my code by characters "a", "b", "c", ... :

<div class="large-3 columns">a
    b<% if @is_completed: %>c
        d<span class="label">e
            completed
         f</span>g
    h<%end%>i
j</div>

And here is what I've seen >>> h 9 i:

<div class="large-3 columns">"abcd"
    <span class="label">
        e completed f
    </span>
    "gh9ij"
</div>

But the numbers are different? Not only "9".

What's wrong?


Solution

  • Hello everyone,

    Firstly, I'm sorry because at the beginning I couldn't find similar question at Stackoverflow.

    Secondly, I know the answer.

    There is the same issue: Eco template renders integer when using 'end' statement

    @Phoeniks tells that installing node.js could solve the issue. And it's true. But I must supplement him. You should specify path to Node.js in the Environment Variables in "Path".

    Thank to everyone.