Hi, I have a form which generates statistics: form.rhtml --> /my_big_app/stats/generate --> view_results.rhtml My method ''generate'' generates an array of statistics @results [hash_1,hash_2,etc.] and I want to display graphics with gruff in my view_results.rhtml page: @results.each do |result| generate_graphic(result) end My helper generate_graphic simply renders <img src=''/my_big/app/graph_controller/generate_image/''> (I can''t use image_tag since it automatically adds now a .png). So how can I easily pass my hashes to my graph_controller? I want to have a params[:stats] = my_hash for the generate_image method but I need to flatten the hash which is ugly with a whole bunch of data. Do you have any idea? -- ,========================. | Pierre-Alexandre Meyer | | email : pam-1sEOgp2Wo8Qdnm+yROfE0A@public.gmane.org | `========================'' --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Pierre-Alexandre Meyer wrote:> Hi, > > I have a form which generates statistics: > > form.rhtml --> /my_big_app/stats/generate --> view_results.rhtml > > My method ''generate'' generates an array of statistics @results > [hash_1,hash_2,etc.] and I want to display graphics with gruff in my > view_results.rhtml page: > > @results.each do |result| > generate_graphic(result) > end > > My helper generate_graphic simply renders <img > src=''/my_big/app/graph_controller/generate_image/''> (I can''t use > image_tag since it automatically adds now a .png). > > So how can I easily pass my hashes to my graph_controller? I want to > have a params[:stats] = my_hash for the generate_image method but I need > to flatten the hash which is ugly with a whole bunch of data. > > Do you have any idea?Store it directly in the session object or store it somewhere else and point to it with the session id? -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sat, Mar 17, 2007 at 06:38:13AM -0700, Michael Wang wrote :> Store it directly in the session object or store it somewhere else and > point to it with the session id?Actually, it''s what I''m currently doing but I''m not persuaded it''s the proper.superlative (propest? sounds weird) way to do this, since it''s a lot of information which is periodically updated. -- ,========================. | Pierre-Alexandre Meyer | | email : pam-1sEOgp2Wo8Qdnm+yROfE0A@public.gmane.org | `========================'' --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---