Rails Access Folder in Public Folder

I have a structure like this (for example):

 public
   art_im
     folder1
        img01.jpg

What do I need to write to access this img01.jpg in the tag? I'm trying to

= image_tag("#{Rails.root}/public/art_im/images_#{@graphics.id}/#{@grp.id}.jpg", :alt => "#{@art.nr}")

but i get in html <img alt="lalala" src="/home/prog/project/Shop/public/art_im/images_32/214800.jpg">

but how to connect on my server and get these images?

+5
source share
1 answer

When your application is launched by the web server, its webroot will be public. So this should work:

= image_tag("/art_im/images_#{@graphics.id}/#{@grp.id}.jpg", :alt => "#{@art.nr}")
+7
source

All Articles