Matthew Williams
2007-Sep-10 19:01 UTC
Need assistance figuring out the logic for my controller
Good afternoon, I''m working on a small app that generates some dynamic charts using JFreeCharts. I have a view that contains some different chart links in a side bar. Then in the center of the page I have a div for the charts. When clicking a chart link I would like to do the following: - Place a spinner in the chart display div - Generate CSV file of data to disk (I''ve got an array with the data, writing it is no problem) - Generate chart from CSV file (done using this technique: http://wiki.rubyonrails.org/rails/pages/HowtoGenerateJFreeCharts) - Display chart in the main div Can this be done using an RJS template? I built a skeleton RJS template so it would mimic what I ultimately want to do for my page: page.replace_html :chartStatus, ''<h2>Generating your chart data.</h2>'' page.visual_effect :highlight, ''chartStatus'', :duration => 3 page.replace_html :chartDisplay, ''<img src="../../images/ spinner.gif">'' page.delay(5) do page.replace_html :chartStatus, ''<h2>Done. Click chart for larger version or right click to save.</h2>'' page.visual_effect :highlight, ''chartStatus'', :duration => 3 page.replace_html :chartDisplay, ''Chart goes here.'' end I''ll plug away and see if I can find any other instances of this, thanks in advance for any help. -Matt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---