<%@election.candidates.length.times do |count|-%>
<% if (count%2)==0-%>
- <img src="/images/widget_dark.png"
- style="position:absolute;top:<%=(count+1)*53%>px;">
- <% else -%>
- <img src="/images/widget_light.png"
- style="position:absolute;top:<%=(count+1)*53%>px">
+ <img src=" <% if @bg1 -%>
+ <%= url_for @bg1.public_filename %>
+ <% else %>
+ /images/widget_dark.png
+ <% end -%> " style="position:absolute;top:<%=(count+1)*53%>px"/>
+ <% else -%>
+ <img src=" <% if @bg2 -%>
+ <%=url_for @bg2.public_filename %>
+ <% else %>
+ /images/widget_light.png
+ <% end -%>"
+ style="position:absolute;top:<%=(count+1)*53%>px">
<% end -%>
<p class="position" style="top:<%=(10+(count+1)*53)%>px;left:10px">
<%=count+1 -%>