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:

Image


16:

Original: <%= @image.filename %>


17: <%= image_tag @image.public_filename, :size => @image.image_size
%>
18:
19:
20:

Also, when i comment out the line with <!-- <%= image_tag etc …

i still get the same error ?

has anyone has this problem or got it working on their apps ?

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