Forum: Ruby on Rails Total Count Using "eval" in a single raw

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Rake N. (Guest)
on 2009-01-08 10:23

Can anyone help me to get the "namecount" using eval, see the data

>> namecount = eval(':name=>{1=>{1=>{"first_name"=>"leon", "last_name"=>"may"}, 
2=>{"first_name"=>"lion", "last_name"=>"king"}}}')

I want an output should be "namecount = 2", because I'm counting how
many "name" in one raw (1record).

Thanks in Advance!
This topic is locked and can not be replied to.