Skip to content

Instantly share code, notes, and snippets.

@mgswolf
Last active August 29, 2015 13:57
Show Gist options
  • Save mgswolf/9676542 to your computer and use it in GitHub Desktop.
Save mgswolf/9676542 to your computer and use it in GitHub Desktop.
#show.html.erb
<%= link_to show_image(r.imagem_url(:thumb)), reclamacao_path(r) %>
<%= link_to reclamacao_path(r) do %>
<%= image_tag(r.imagem_url(:thumb)) if r.imagem.present? %>
<% end %>
#application_helper.rb
def show_image(image, style = :thumb)
image ? (image_tag image(style)) : 'noimage'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment