我正在尝试为我的图像重型网站安装https://github.com/jassa/lazyload-rails。
添加所需的lazy:true时,图像不显示
Ruby on Rails 5的语法需要不同吗?
<%= link_to image_tag(post.image_url.to_s, lazy: true), post_path(post), remote: true %>
谢谢
的Gemfile
gem "lazyload-rails"
application.html.erb
<script>
$("img").lazyload();
</script>
你必须下载jQuery Lazy Load Plugin脚本并将其放在vendor/assets/javascripts
下