I want to routinely make updated hashes in controller methods and use
the data in views. Can I put this in a method and be done?
my_hash = {}
widget_holder = Cars.find(:all)
my_hash = widget_holder.map { |widget| widget.parking_spot_number,
widget.name}
Is that it? Is an array of two element arrays a hash or is there
another step?
I know I’ve seen this done but i cant find it in my books or via search.
Can I then go:
<%=h my_hash[36] %> in a table slot and get it to return "
Blue Cadillac Eldorado"
if the instance of Car had values for name(Blue Cadillac Eldorado) and
parking
spot(36) accordingly?
Am I missing a step? (or two?)