I have two objects Task and Asset and I want to view image in show task.
Here is my to models
Task.rb
has_many Assets :as => :attachable
And
Asset.rb
has_attached_file :photo, :styles => { :large => "371*251>",
:small =>
"72*72>"},
:url => "/assets/:id/",
:path =>
":rails_root/public/assets/:id/:style.:extension"
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(@task.id)%>
<%if !@photo.blank? %>
<%= image_tag (@photo.photo.url(:small) )%>
i''m getting html out put of <img
src="/assets/4/?1266410329"
alt"?1266410329">
it should be <img src="/assets/4/small.jpg"
alt"small.jpg">
Any help would be grateful
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.