Dynamically modify id within html tag using embedded ruby -
how can dynamically set id within html tag?
specifically, i'm trying this:
<td <% "id=unit_" + unit.id.to_s %> > *content goes here* </td>
where unit.id integer variable.
can used embedded ruby (i.e. <% %>) within html tag this?
if not, how else can achieve i'm trying do?
<td id="<%= unit.id.to_s %>">...</td>
Comments
Post a Comment