Skip to content

Instantly share code, notes, and snippets.

@NuckChorris
Last active December 14, 2015 19:58
Show Gist options
  • Select an option

  • Save NuckChorris/5140311 to your computer and use it in GitHub Desktop.

Select an option

Save NuckChorris/5140311 to your computer and use it in GitHub Desktop.
module ArtworksHelper
def thumbnail_for_artwork (artwork)
return content_tag(:figure, { :class => 'thumbnail' }) do
return "#{
return link_to artwork do
return image_tag(artwork.image_url(:thumb).to_s)
end
}#{
return content_tag(:caption) do
return "#{
return content_tag(:h2, artwork.title)
}#{
return content_tag(:p, artwork.description)
}".html_safe
end
}".html_safe
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment