How to iterate an array of hashes and return the interested array

Hi folks,

I have the following structure /json like:

{

That isn't valid ruby syntax. Are you trying to parse a file with that syntax?

Take a look at this, http://developer.yahoo.com/ruby/ruby-json.html

my_array.select{|item| item[:key] == my_criterion}

..will give you an array of items that meet your needs if the 'item' is a hash.

I already parsed the json call. The idea is that i want to access a certain hash within :item => or return the slug value for title => "xyz"

Well, it looks to me like you have an outer hash with key/values, and a value is an array of hashes, so you would do this:

main_hash["items"][1]["title"] ==> 'xyz'

main_hash["items"][1]["title"] ==> 'xyz'              ^ ^              > >            array |                    >                   hash