I have a rails block like this -
<% if blah%>
<% foo(100).each_with_index do |data| %>
<img src="<%= data %>" onclick="yay(<%= data %>)">
<% end %>
And yay() should log the value of data.
However, the dynamically generated elements from the rails method foo() don't work with onclick. A static image does. Is there some way around this?