lundi 9 mai 2016

CarrierWave upload picture and show in html page

I have finished to use Carrierwave to upload the picture. And the picture has been store in default file.

uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}

Now I want the picture to be shown in my html homepage.

How could I pull the picture from this default file route.

My html code is

<img class="img-rounded" src="uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" alt="Generic placeholder image" width="200" height="160">

However, in this way, the picture can not be shown. Thanks for helping

Aucun commentaire:

Enregistrer un commentaire