[英]Adding alt attribute with rails?
How would I add an alt=""
to this line of code? 如何在此代码行中添加
alt=""
? <%= image_tag current_user.image if current_user.image %>
Everything I have tried gives me a syntax error! <%= image_tag current_user.image if current_user.image %>
我尝试过的所有内容都给我带来语法错误!
像这样:
<%= image_tag(current_user.image, alt: "great image") if current_user.image %>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.