Dynamic images

Hi,

I have a controller that uses gruff to create a chart. I would like
to be able to return this image back to the view without having to dump
the image to disk first. Does anyone have sample code for the controller
and view to handle such a problem ?

Thank you all !!

On Dec 4, 2005, at 1:05 PM, KiteSurfer KiteSurfer wrote:

Does anyone have sample code for the controller
and view to handle such a problem ?

Create a specific action to generate the image and send it with
send_data.

–Steve

Streaming.html#M000041

Thanks Steve !! That helps but…

send_data will forward me to a new page. I want to be able to display
the chart within the existing page ?

I guess I am not really sure how to formulate the send_data from within
the page ??

On Dec 4, 2005, at 3:27 PM, KiteSurfer KiteSurfer wrote:

I guess I am not really sure how to formulate the send_data from
within
the page ??

Create a separate dedicated action, just for the image, then within
whatever page you just link to that like a regular image.

HTH,
Steve

Got it !! Thanks Steve you tough me something cool today…

Now do you know how to accomplish the same thing using an ajax call ?

I’m not sure if it’s possible, as ajax only deals with text based
data. However, you might be able to send an tag that loads a
dynamic image…

On Dec 4, 2005, at 4:23 PM, KiteSurfer KiteSurfer wrote:

Now do you know how to accomplish the same thing using an ajax call ?

Someone else will have to chime in to help you with that. :slight_smile: Good
luck.

–Steve

hmmm, a noob ruby question. After I gem install gruff, I opened the irb
to
try require ‘rubygems’ and require ‘gruff’, and then I got two false.
Why?
I’m using ruby 1.8.3 on WinXP. I also put the sample code from gruff’s
home
page into a controller. It seems rails still didn’t know the name of
‘gruff’.

Thanks,

Sky

Steve : No problem. Thanks again for the help !!
I think I need to dig in google map apis to try to figure this one out.
It
must be achievable using javascript.

Sky: I have successfully installed Gruff on both linux and windows. For
both of these you need to have ImageMagick or GraphMagick installed. You
also need Rmagick. Somehow it was not clear from the docs that gruff had
these dependencies when I started to look at it…

Hope this helps…