mercredi 10 mai 2017

Rails how create a fallback without carrierwave or other upload gem?

I'm trying to create a fallback helper for a object but on the page just shows the image broken link and the assets url. so, know how?

def display_image(pdata)  
    unless pdata.nil? 
      image_tag(pdata.image) 
    else
      image_tag("/assets/fallback/small_foto.png")
     end    
end

Aucun commentaire:

Enregistrer un commentaire