Jackie Chan
Jackie Chan

Reputation: 2662

Paperclip outputs url instead of image

In my show view:<dd><%= @truck_fleet.avatar.url(:medium) %></dd>

Get the output: /system/truck_fleets/avatars/000/000/001/medium/logo.thumbnail.png?1354107497

Def, I would like to display avatar instead for URL :)

Anyone has encountered this issue before?

Upvotes: 0

Views: 106

Answers (2)

TopperH
TopperH

Reputation: 2223

Just tell rails it is an image:

<%= image_tag @truck_fleet.avatar.url(:medium) %>

Upvotes: 3

stuartc
stuartc

Reputation: 2274

All you need to do is wrap the URL in an <img> tag under the src attribute like this:

<img src="<%= @truck_fleet.avatar.url(:medium) %>"/>

Upvotes: 1

Related Questions