I am new to Ruby on Rails and working on Graph creation using 'Gruff'. In controller I am writing below code to create image in assets/images.
g.write("#{Rails.root}/app/assets/images/chart/chart.png")
and in view : <%= image_tag("chart/chart.png", :alt => "Image missing") %>
By using this way I can perfectly see image in the view, but storing images in assets/images will consume a lot of memory.
Is there an alternative to create image dynamically without storing it in assets/images?
In the controller instead of writing the image, use:
It will not create image but display it on view.