class BalloonsController< ApplicationController

  def show


    url = URI.parse("http://api.heylium.io/public/v1/balloons/#{params[:id]}")
    req = Net::HTTP::Get.new(url.to_s)
    res = Net::HTTP.start(url.host, url.port) {|http|http.request(req)  }
    if res.code == "200"
      @balloon =  JSON.parse(res.body,  {:symbolize_names => true})

      url = URI.parse("http://api.heylium.io/public/v1/balloons/#{params[:id]}/comments")
      req = Net::HTTP::Get.new(url.to_s)
      res = Net::HTTP.start(url.host, url.port) {|http|http.request(req)}
      @comments =  JSON.parse(res.body,  {:symbolize_names => true})
    else
      balloon_not_found
    end


  end
end
