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: