I’ve been looking for this and can’t seem to find a solution:
I have a content_tag block with a lot of logic in a helper (probably not great, but it is what it is). There’s a variable in there that needs to increment. However, the code like this
num = num + 1
Actually ends up outputting num + 1 instead of incrementing it. Is there a way to temporarily evaluate that expression instead of outputting it in the buffer?
Thanks
The
content_taghelper will return the result of the block, which will be the last line inside the block. I am guessing that you’re incrementing code is the last line – try moving the output string after this line.