Updating view.html.erb with response from REST API

I have an app that starts a server. When it starts the server, it sends a message to a separate REST API on server B. Server B then sends a json message back.

{
"status": "success",
"url": "https://...."
}

I want to show that url in view.html.erb so the user can see it. I’ve seen a few posts about how this could be done in before.sh.erb but at least with how I’m currently setting it up, it makes sense to me to run it in script.sh.erb. I could write it to a file and then output the contents of that file?

I think I’ve seen people show the content of output.log but I can’t find any of those at the moment. Anyone have any ideas?