# Updating view.html.erb with response from REST API

**URL:** https://discourse.openondemand.org/t/updating-view-html-erb-with-response-from-rest-api/4802
**Category:** Get Help
**Tags:** question
**Created:** [March 18, 2026, 12:17am UTC](https://discourse.openondemand.org/t/updating-view-html-erb-with-response-from-rest-api/4802 "2026-03-18T00:17:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![brandonbiggs](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/brandonbiggs/32/1696_2.png) [@brandonbiggs](https://discourse.openondemand.org/u/brandonbiggs)
#### Post date: [March 18, 2026, 12:17am UTC](https://discourse.openondemand.org/t/updating-view-html-erb-with-response-from-rest-api/4802/1 "2026-03-18T00:17:42Z")

</div>

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.

```auto
{
"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?

---

<div class="post-metadata">

### Author: ![anderss](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/anderss/32/3359_2.png) [@anderss](https://discourse.openondemand.org/u/anderss)
#### Post date: [March 18, 2026, 3:39pm UTC](https://discourse.openondemand.org/t/updating-view-html-erb-with-response-from-rest-api/4802/2 "2026-03-18T15:39:04Z")

</div>

Hey!

Here are a few examples off the top of my head that do similar things:

> [@How to Customize Interactive App Card](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306):
>
> Hello I would like to customize the interactive app card title with one of the form attributes selected by the user. For example, if the users selects Option A or Option B, I would like Option A or Option B text in the interactive app card title.

> [@Show Projected Start time on Interactive Sessions page](https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481):
>
> When submitting jobs through OOD, many of our users are confused about what to do when they observe a job in the “Queued” state for a long time. It would be helpful to have the Projected Start Time (from squeue –start output) shown in the card for the job. This could take the same spot where “Time Remaining” is for running jobs.

> **[GitHub - EpiGenomicsCode/ProteinStructure-OOD](https://github.com/EpiGenomicsCode/ProteinStructure-OOD)**
>
> Contribute to EpiGenomicsCode/ProteinStructure-OOD development by creating an account on GitHub.

Lastly (and my least favorite way to do it), the “multitenant-instruction” app in my Multitenant Apps will produce a card that renders a markdown file. It will display any changes to the file each time it gets re-rendered in the dashboard. [It’s easy to do](https://github.com/WFU-HPC/OOD-MultitenantApps/blob/main/apps-delivery/multitenant-delivery_readfile/view.html.erb). This was what I did to display the animated Deacon gifs during my presentation.

---

<div class="post-metadata">

### Author: ![brandonbiggs](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/brandonbiggs/32/1696_2.png) [@brandonbiggs](https://discourse.openondemand.org/u/brandonbiggs)
#### Post date: [March 18, 2026, 4:50pm UTC](https://discourse.openondemand.org/t/updating-view-html-erb-with-response-from-rest-api/4802/3 "2026-03-18T16:50:49Z")

</div>

> [@anderss](#):
>
> [GitHub - EpiGenomicsCode/ProteinStructure-OOD · GitHub](https://github.com/EpiGenomicsCode/ProteinStructure-OOD)

That got me to where I needed to be! Thanks Sean!!

If anyone comes across this in the future with the same question, here’s what I ended up doing:

```bash
$ touch template/url.txt
$ cat view.html.erb
<%= File.read(url_file) %>
$ head -5 submit.yml.erb
---
batch_connect:
  template: "basic"
  conn_params:
    - url_file
$ cat template/before.sh.erb
#!/bin/bash
export url_file=$(pwd)/url.txt
$ cat template/script.sh.erb
echo "your content" > ${url_file}

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)
#### Post date: [September 14, 2026, 4:51pm UTC](https://discourse.openondemand.org/t/updating-view-html-erb-with-response-from-rest-api/4802/4 "2026-09-14T16:51:19Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
