我写过:
<div id="Table_01">
<div id="SAVEonSHIRTS-website-homepage-01">
<image_tag("SAVEonSHIRTS_website_homepage_01.png")>
</div>
<div id="SAVEonSHIRTS-website-homepage-02">
<image_tag("SAVEonSHIRTS_website_homepage_02.png")>
</div>
<div id="SAVEonSHIRTS-website-homepage-03">
<image_tag("SAVEonSHIRTS_website_homepage_03.png")>
</div>
图像位于assets文件夹下的images文件夹中。但是,图像仍未显示在localhost中。有什么想法吗?
提前致谢!
埃尔顿
答案 0 :(得分:0)
我假设您使用的是erb
,如果需要,您需要使用erb
scriptlet标记<%= ... %>
示例:
<%= image_tag("SAVEonSHIRTS_website_homepage_01.png") %>
答案 1 :(得分:0)
您可以尝试使用以下
<%= image_tag("SAVEonSHIRTS_website_homepage_01.png", :alt => "Sample App", :class => "round" , :width => "300") %>
alt => If image is not present then this message will be displayed
class => If you want to assign any class
width/hight => if you want to specify specify width and height .