I write some code that displays some stuff retrieved from a web service
and stuffs it all into a ruby hash. The view that displays the hash
uses symbols to access attributes.
I originally wanted to reuse this same view when I pull some data I
cached (in a DB) from the web service - this is my reason for wanting to
use symbols. However it looks like I’ll have to create two separate
views which essentially do the same thing. Oh well…
Rob B. wrote:
On Nov 10, 2006, at 6:58 PM, Vishal wrote:
Sure…but that seems like a hack. Is there a particular reason
why ActiveRecord returns string based keys for queries and
not symbols? Is there a way to fix this?
Why not just:
or if you really feel the need to use a symbol:
but let the ActiveRecord attribute methods do their thing.
Rob B. http://agileconsultingllc.com