I have a products controller where i show all my images available in a certain folder:
def index
@images = Dir.glob("app/assets/images/database/*.jpg")
end
Now i'm trying to link each image to an individual dynamic show page:
def show
@images = Dir.glob("app/assets/images/database/" + params[:id] + ".jpg")
end
Sadly i get an error "no implicit conversion of nil into String" for quite a while now.
Ideally i want to automatic render all the images from the database folder on the index page and link them individually to the show action where i use exifr to get specific information about each image.
It's not a good practice. You should use any image uploader and set teh default image. E.g. for CarrierWave: