Rails Heroku加载背景图像的一部分 [英] Rails Heroku loading part of the background image

查看:165
本文介绍了Rails Heroku加载背景图像的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Heroku上有一个rails应用程序。在这个应用程序中,我有背景图像,我称之为;

I have a rails app on Heroku. In this app I have background images and I call them as;

<div class="fill" style="background-image:url('<%= asset_path ('4.jpg') %>');">

背景图片工作但突然间,它开始显示其中的一部分。

The background images working but suddenly, it started showing some part of them.

为什么会这样?实现了主页旋转木马滑块bakground图像也发生了。但是当我查看背景链接时,它会显示完整的图片,但图片没有加载到滑块上。

Why is this happening? Realized that also happens for the main page carousel slider bakground images. But when I check background link, it shows the full picture but image not loading on slider.

推荐答案

尝试使用image_tag。以下是位于app / assets / images中的图片的示例

Try to use image_tag. Here is an example with an image located in app/assets/images

<div class="fill">
    <%= image_tag("4")%>
</div>

这篇关于Rails Heroku加载背景图像的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆