Paperclip and viewing images

I have two objects Task and Asset and I want to view image in show task.

Here is my to models


has_many Assets :as => :attachable



has_attached_file :photo, :styles => { :large => “371251>", :small =>
:url => “/assets/:id/”,
:path =>

belongs_to :attachable, :polymorphic => true

I have the multiple images upload working but when i try to view them in
show.erb.html code below

<% @photo = Asset.find_by_attachable_id(>

<%if !@photo.blank? %>

<%= image_tag ( )%>

i’m getting html out put of <img src="/assets/4/?1266410329"

it should be <img src="/assets/4/small.jpg" alt"small.jpg">

Any help would be grateful

Was simple fix in the end.

Had not specified what naming convention i was trying to call back

I needed to add :style_:basname.:extension to my model code

:url => “/assets/:id/:style_:basename.:extension”,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs