Reputation: 1063
I've searched for about an hour on this and couldn't find an answer so maybe someone here can help. I have pdf uploads enabled for my model, but when I link to it in my view, even if the record doesn't have a pdf in it it still links to missing.png. I'd like it to return nil if there's no pdf so I can just do link_to_unless. I tried setting :default_url to a blank string but I guess that doesn't count as nil
Upvotes: 1
Views: 336
Reputation: 1063
<%= link_to 'Resume', page.upload(:original) %>
Didn't know about the :original part.
Upvotes: 1