[Borges-users] Dynamically creating images with Borges

Слепнев Владимир slepnev_v at rambler.ru
Mon May 3 14:31:00 EDT 2004


> The problem is not the image generation, but how to send the image data
> back to the client (register a callback/url). 

Here's how I did it 5 minutes ago (this is from a controller's 
render_on(r)):

data = File.open('plasm.jpg') {|f| f.binmode; f.read} # we have some 
binary data
r.image r.url_for_document(data,"image/jpeg") # we make the image's 
URL point to this data, with a mime-type

I don't know how this works with caching right now; Eric? If it's OK, 
we could make some kind of shortcut to this code in HtmlRenderer - 
this is often needed.

Vladimir Slepnev


More information about the Borges-users mailing list