Donna Massimo wrote:> In my controller, I have this simple code:
>
> hashThing = Hash.new{ |hash, key| hash[key] = [] }; # this declares a
> hash with array values
> hashThing[''something''] << "value1"
<< "value";
> flash[:quick_store_hash] = hashThing;
>
> When I run it, I get a TypeError in Controller#action. The error message
> is: "can''t dump hash with default proc" and that makes
no sense to me.
> I''m new to ruby/rails, and would appreciate any help.
>
> Thanks!
> donna
I think I have it figured out. If I do this:
hashThing = Hash.new();
hashThing[''something''] = Array.new();
hashThing[''something''] << "value1" <<
"value";
flash[:quick_store_hash] = hashThing;
...all is well. Hope this helps somebody else out there :-)
--
Posted via ruby-forum.com.
--~--~---------~--~----~------------~-------~--~----~
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
groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---