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 !! -- Posted via http://www.ruby-forum.com/.
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][1]. --Steve [1]: http://api.rubyonrails.com/classes/ActionController/ 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 ?? -- Posted via http://www.ruby-forum.com/.
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 ? -- Posted via http://www.ruby-forum.com/.
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. :) Good luck. --Steve
I''m not sure if it''s possible, as ajax only deals with text based data. However, you might be able to send an <img> tag that loads a dynamic image... On 12/4/05, Stephen Waits <steve-g8GSkY9QmIteoWH0uzbU5w@public.gmane.org> wrote:> > 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. :) Good > luck. > > --Steve > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
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 On 12/4/05, Josh Charles <josh.charles-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m not sure if it''s possible, as ajax only deals with text based > data. However, you might be able to send an <img> tag that loads a > dynamic image... > > On 12/4/05, Stephen Waits <steve-g8GSkY9QmIteoWH0uzbU5w@public.gmane.org> wrote: > > > > 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. :) Good > > luck. > > > > --Steve > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
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... -- Posted via http://www.ruby-forum.com/.