Rails 3 does not look in the shared folder for assets on the display method

In my view representations, whenever I try to display an image using image_tag builder, the rails do not look for images in the shared folder inside my views ...

For instance:

<%= image_tag "thumbnails/fish.jpg" %>

Let's do this:

ActionController::RoutingError (No route matches [GET] "/uploads/thumbnails/fish.jpg"):

I use the paperclip gem for my download model and I save the downloads to a different folder than the public folder for security reasons, and yes, this view view occurs inside the download controller ...

In my download model, I use this line to save downloads to a non-public folder:

has_attached_file :upload,  :path => ":rails_root/:class/:id/:basename.:extension",
                            :url => ":rails_root/:class  /:id/:basename.:extension"

Route routes:

upload GET    /uploads/:id(.:format)                                                                 {:action=>"show", :controller=>"uploads"}
       PUT    /uploads/:id(.:format)                                                                 {:action=>"update", :controller=>"uploads"}
       DELETE /uploads/:id(.:format)                                                                 {:action=>"destroy", :controller=>"uploads"}
              /download/:id(.:format)                                                                {:controller=>"uploads", :action=>"download"}

Edit . img src , , , .

+5
2

, , Rails , :

"thumbnails/fish.jpg"

"/thumbnails/fish.jpg"

, ...

+7

true:

config.serve_static_assets = false

/*. rb (, development.rb).

, , CHMOD 777 / .

SO >

+2

All Articles