I am trying to check if an image file exists in the asset pipeline and if it not there display a default. If it is there I want to display it instead. Where am I going wrong?
<% if "#{@person.user_name}.jpg".nil %>
<%= image_tag("default.gif") %>
<% else %>
<%= image_tag("#{@person.user_name}.jpg") %>
<% end %>
Aucun commentaire:
Enregistrer un commentaire