Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- send_data g.to_blob, :disposition=>'inline', :type=>'image/png', :filename=>'top_n.pdf'
- :complete => "updateImg(id_of_div, request.responseText)"
- function updateImg(id, img)
- {
- $(id).innerHTML = '<img src="' + img + '" />';
- }
- def graph
- # get the relevant data for 'g' here
- respond_to do |format|
- format.html #uses the default view if relevant (good for debugging)
- format.png do
- send_data g.to_blob,
- :disposition=>'inline',
- :type=>'image/png',
- :filename=>'top_n.pdf'
- end
- end
- end
- <img src="controller/graph.png" alt="Something"/>
Add Comment
Please, Sign In to add comment