Converting JSON response to hash

Rails newbie here - I’m grabbing information from an API and it “looks” like I’m getting a hash back, but I can’t address any of the keys in the hash as I’m getting an error that an object NIL doesn’t take a key.

class AtisController < ApplicationController
    
    def index
        @atis_information_list = []
        airport_list = ["KBDL", "KBOS", "KPVD", "KACK", "KALB", "KGON", "KOXC", "KPWM", "KATL"]
        airport_list.each do |airport|
            @atis_information_list.push(pull_atis(airport))
        end         
        #@atis_information_list = pull_atis(airport_list)
    end

    private

    def request_api(url)
        response = Excon.get(
            url
        )

        return nil if response.status != 200

        parsed_JSON = JSON.parse(response.body)[0]
        return parsed_JSON
    end

    def pull_atis(airport)
        request_api(
        "http://datis.clowd.io/api/#{CGI.escape(airport)}"
        )
    end

end```

  <h1>ATIS Info</h1>
  <h4> <%= DateTime.now.utc %></h4>

  <p>
    <% @atis_information_list.each do |atis| %>
    <%= atis %>
    <% end %>
  </p>
```

Here is the rendered output right now. I’d like to just have the “airport” and “datis” information so I can render into an HTML table.

{“airport”=>“KBDL”, “type”=>“combined”, “code”=>“N”, “datis”=>“BDL ATIS INFO N 2151Z. 34004KT 10SM FEW200 FEW250 05/M09 A3026 (THREE ZERO TWO SIX). RUNWAYS 24 AND 33 IN USE, EXPECT ILS APPROACH. NOTAMS… 5G NOTAMS IN EFFECT FOR BDL CNTC FLIGHT SERVICE FREQUENCIES. READ BACK ALL HOLD SHORT INSTRUCTIONS AND ASSIGNED ALT. HIWAS INFO FOR CT GEO AREA AVAILABLE ON FSS. …ADVS YOU HAVE INFO N.”}

Ok. I now understand that I was passing back an array of hashes, so I updated my HTML code to go deeper.

      <table>
        <thead>
            <th>
                Airport
            <th>
                Type
            <th>
                Code
            <th>
                D-ATIS
      
        <tbody>
            <% @atis_information_list.each do |value1| %>
            <tr>
                <% value1.each do |value2|%>
                    <td><%= value2 %></td>
                <% end %>
            <% end %>
            </tr>
        </tbody>

I’m now getting this for output…

How do I strip the brackets and keys?

Digital ATIS Information 2023-02-12 00:43:11 UTC Airport Type Code D-ATIS [“airport”, “KBDL”] [“type”, “combined”] [“code”, “P”] [“datis”, “BDL ATIS INFO P 2351Z. 27005KT 10SM FEW250 01/M08 A3028 (THREE ZERO TWO EIGHT). RUNWAYS 24 AND 33 IN USE, EXPECT ILS APPROACH. NOTAMS… 5G NOTAMS IN EFFECT FOR BDL CNTC FLIGHT SERVICE FREQUENCIES. READ BACK ALL HOLD SHORT INSTRUCTIONS AND ASSIGNED ALT. HIWAS INFO FOR CT GEO AREA AVAILABLE ON FSS. …ADVS YOU HAVE INFO P.”]

Well, I got it working. Not sure if there was an easier approach.

      <table class="table">
        <thead class="thead-dark">
            <th>
                Airport
            <th>
                Type
            <th>
                Code
            <th>
                D-ATIS
      
        <tbody>
            <% @atis_information_list.each do |value1| %>
            <tr>
                <% value1.each do |value2|%>
                    <td><%= value2[1] %></td>
                <% end %>
            <% end %>
            </tr>
            <tr><br></tr>
        </tbody>