我在下面的帮助器中得到这个错误("参数数错误(给定1,期望0)")。
module PropertiesHelper
def property_thumbnail
img = property.photo.present? ? property.photo.thumb.url : "placeholder.png"
image_tag img, class: "property_thumb"
end
end
在你的属性控制器
helper_method :property_thumbnail
def property_thumbnail
img = property.photo.present? ? property.photo.thumb.url : "placeholder.png"
image_tag img, class: "property_thumb"
end