Adam Madd
2006-Sep-28 10:57 UTC
acts_as_attachment with restful application, image_tag fails
i have the following routes: map.resources :categories do |category| category.resources :products do |product| product.resources :images end end The A_A_A plugin works fine when uploading images. I can view the follwoing url to see details such as image size and the url''s for images: category/1/product/2/images/2 When selecting the url for an image i can view the image at the following url: http://localhost:3000/files/24/100_1256_thumb.JPG THE PROBLEM: When i add an image_tag to the show page to view the image i get the following error. Notice that it considers the category_id to be the url of the image. DO i need to setup a resource for the image''s to be displayed ?? Error: ActionController::RoutingError in Images#show Showing app/views/images/show.rhtml where line #17 raised: image_url failed to generate from {:category_id=>"/files/24/100_1256.JPG", :action=>"show", :controller=>"images"}, expected: {:action=>"show", :controller=>"images"}, diff: {:category_id=>"/files/24/100_1256.JPG"} Extracted source (around line #17): 14: 15: <h4>Image</h4> 16: <p>Original: <%= @image.filename %></p> 17: <%= image_tag @image.public_filename, :size => @image.image_size %> 18: 19: 20: -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Adam Madd
2006-Sep-28 20:33 UTC
Re: acts_as_attachment with restful application, image_tag f
Also, when i comment out the line with <!-- <%= image_tag etc .... i still get the same error ? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Adam Madd
2006-Sep-29 08:40 UTC
Re: acts_as_attachment with restful application, image_tag
has anyone has this problem or got it working on their apps ? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---