I have Ruby code that looks like this:
a = widgets["results"]["cols"].each_with_index.select do |v, i|
v["type"] == "string"
end
I only want to get the index of any values where v["type"] is "string". The outer array of "results" has about 10 values (the inner array of "cols" has two -- one of them having an index of "type"); I am expecting two results returned in an array like this: [7, 8]. But, I am getting results like this:
[[{"element"=>"processed", "type"=>"string"}, 7], [{"element"=>"settled", "type"=>"string"}, 8]]
How can I do this?