I’m trying
<%= link_to image_tag("#{gallery.link_to}"), gallery_path(gallery)
unless gallery.thumbnail_id == 0%>
and get the error:
ActionView::TemplateError (undefined method `image_tag’ for #<Gallery:
0xb7083be4>) on line #23 of app/views/users/index.rhtml
This is my definition of link_to
def link_to
unless self.thumbnail_id == 0
picture = Picture.find(self.thumbnail_id)
path = picture.public_filename(:big_thumb)
return “#{path}”
else
return “”
end
end
Any idea about that error?