Rails 3.1 assets not recognizing new images uploaded by rmagick until server restart

Posted by Mr_Nizzle on Stack Overflow See other posts from Stack Overflow or by Mr_Nizzle
Published on 2011-10-13T07:50:13Z Indexed on 2011/11/18 17:50 UTC
Read the original article Hit count: 338

I have my Rails 3.1.0 application running with passenger in production environment and I have a section where the application allows the user to change his profile picture so I upload the image using an ajax uploader and in my controller I upload the file and generate different sizes for the image with rmagick then I render the new image with an image_tag but the application won't show the image till I restart the server.

What I get is No route matches [GET] "assets/path/to/image.png"

If I restart the server It will show the image, but obviously I can't be restarting the server every once a user uploads a new image.

How can I solve the keeping the assets working the right way?

© Stack Overflow or respective owner

Related posts about ruby-on-rails-3.1

Related posts about rmagick