Ruby on rails 仅当图像为';有空吗
如何编辑下面的代码,因此如果没有@business.logo可用,则没有代码Ruby on rails 仅当图像为';有空吗,ruby-on-rails,paperclip,Ruby On Rails,Paperclip,如何编辑下面的代码,因此如果没有@business.logo可用,则没有代码 = image_tag @business.logo(:thumbnail), :class=> "img-rounded" 当前未上载任何图像时显示: <img alt="Thumbnail" class="img-rounded" src="http://s3.amazonaws.com/callred/businesses/logos/000/000/034/thumbnail/">
= image_tag @business.logo(:thumbnail), :class=> "img-rounded"
当前未上载任何图像时显示:
<img alt="Thumbnail" class="img-rounded" src="http://s3.amazonaws.com/callred/businesses/logos/000/000/034/thumbnail/">
更新
应该询问是否@business.logo.present?
@business.logo
返回始终为真的回形针::附件
对象
更新
应该询问是否@business.logo.present?
@business.logo
返回始终为真的回形针::附件
对象
更新
应该询问是否@business.logo.present?
@business.logo
返回始终为真的回形针::附件
对象
更新
应该询问是否@business.logo.present?
@business.logo
返回始终为真的回形针::附件
对象明白了!这是对我有用的代码
- if @business.logo.present?
= image_tag @business.logo(:thumbnail), :class=> "img-rounded"
明白了!这是对我有用的代码
- if @business.logo.present?
= image_tag @business.logo(:thumbnail), :class=> "img-rounded"
明白了!这是对我有用的代码
- if @business.logo.present?
= image_tag @business.logo(:thumbnail), :class=> "img-rounded"
明白了!这是对我有用的代码
- if @business.logo.present?
= image_tag @business.logo(:thumbnail), :class=> "img-rounded"
当我尝试这样做时,空图像块仍然存在。=图像标记(@business.logo(:缩略图),:class=>“img圆角”)除非@business.logo.blank?当我尝试这样做时,空图像块仍然存在。=图像标记(@business.logo(:缩略图),:class=>“img圆角”)除非@business.logo.blank?当我尝试这样做时,空图像块仍然存在。=image_标记(@business.logo(:缩略图),:class=>“img四舍五入”)除非@business.logo.blank?当我尝试这样做时,空图像块仍然存在。=image_标记(@business.logo(:缩略图),:class=>“img四舍五入”)除非@business.logo.blank?