I’m trying to accomplish the following content in source code:
<div id="box<%=id%>"></div>
Without escaping any signs in Haml.
%div{ :id => "box_<%=id%>" }
produces
<div id='box_<%=id%>'></div>
Right now the only way I can do this with Haml is to use :plain filter and hardcode HTML without using any View Helpers. How can I fix that?
I need this because I’m forced to follow this convention because of third-party syntax convention: JavaScript Micro-Templating
Reference:
You say you’re coding in Haml, but the brackets indicate Erb.
Step 1. Try normal Ruby interpolation:
Step 2. There is no step 2.
Update: When I wrote this answer, I had not used a JS templating framework before. My apologies for not grokking why this was necessary.