I have a div tag in the view that I'd like to update with a graph that I generate via Gruff.
I have the following controller action which does this at the end
send_data g.to_blob, :disposition=>'inline', :type=>'image/png', :filename=>'top_n.pdf'
Now if I directly invoke this action, I can see the graph. (More details here if reqd.)
If I add a link_to_remote_tag
that calls the above action via AJAX passing in specific input, generates this graph and tries to update a placeholder div tag... I see gibberish.
I think I can write the graph to a png file with g.write(filename.png)
how do I embed the graph within the div tag in the view at run-time?