Hi everyone I generate two images (charts - png format) in my controller with "Gruff". The images are saved in /public/images. That runs correctly! So rails is calling the template "create_chart.rhtml". After, I linked the image with the html tag into the template. When the site is appearing in the browser, the images are linked, but the wrong one are there. It seems like, that rails are so fast, that the images aren't generate at this time. When I press F5 to reload the site, the correct images are appear. Can anyone help to solve this problem? Controller: def create_chart image.write('public/images') end View: <img src="images/image1.png">
on 2007-01-05 11:53
on 2007-01-05 12:18
This could be a caching problem due to client/server time differences. Are you running Rails and your web browser on different machines? If so, are the system clocks synchronized (using network time clients)? A difference of a few seconds could cause the problems you are experiencing.
on 2007-01-05 12:35
It runs on the same machine, so the system clock is synchronized. How can I reload the template?
on 2007-01-05 14:07
<%= image_tag 'public/images/test1.png' %> So the image will not cached!