search for: old_favorite_food

Displaying 1 result from an estimated 1 matches for "old_favorite_food".

2006 Jan 17
5
Hash.new{|h,k| h[k] = ""} ... but for views?
I sometimes buy myself a default value for a hash using something like this: h = Hash.new{|h,k| h[k] = ""}. I can now pass ''h'' any key and if a value has not yet been associated with that key I receive an empty string. I would love to do something similar in my partials so that I wouldn''t have to worry about passing in every variable that is referenced.