Always check to see if there is a variable nilbefore using it in a view.
<% image_tag this.profile.expiring_url(180) unless this.profile.nil? %>
I am sure there is a more elegant solution to the problem, but this should get you started.
source
share