lazyload-rails icon indicating copy to clipboard operation
lazyload-rails copied to clipboard

Configuration of placeholder only works with online image

Open alexandergantikow opened this issue 7 years ago • 1 comments

Your proposed code for configuring the placeholder only works with an online source. If I use a local file I always get a route error. I'm not a rails pro by far... So tell me if I'm wrong :)

alexandergantikow avatar Feb 07 '18 21:02 alexandergantikow

Hello everyone, I know that the issue dates a little but I had the same problem recently. So I am not an expert on RoR but I noticed that once the assets are compiled they are not separated in different development folder (images, stylesheets, javascripts and others). So in the config/initializers/lazyload.rb file the configuration for a static file looks like this:

the gif I use as a custom file is named lazyloader.gif

Lazyload::Rails.configure do |config|
  config.placeholder = '/assets/lazyloader.gif' // --> real path are assets/images/lazyloader.gif
end

I hope it will serve to solve future issues.

PS: I'm French be indulgent with my english please ^^

Paul-maire avatar Aug 07 '18 10:08 Paul-maire