I have the following array:
["{\"id\":1,\"name\":\"A\"}", "{\"id\":20,\"name\":\"B\"}"]
I get this array from redis and I need to iterate and access id and name keys. I really need to call JSON.parse in every iteration ?
How can I iterate and display data ?
JSON.parsein every iteration?" - on every element, yes.<% visitors.each do |v| %> <% visitor = JSON.parse(v) %>def visitors @options[:visitors].map { |visitor| JSON.parse(visitor) } end