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

Popular posts from this blog

html - jquery - p element wont show after I hid it -

python - BeautifulSoup: How to get the nearest tag -

php - Return Last Insert ID with PDO -