Url, hash, flatten, etc

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 (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 M. |
| email : [email protected] |
`========================’

Pierre-Alexandre M. wrote:

@results.each do |result|

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 W.

On Sat, Mar 17, 2007 at 06:38:13AM -0700, Michael W. 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 M. |
| email : [email protected] |
`========================’