# Passing context variables to view.html.erb

**URL:** https://discourse.openondemand.org/t/passing-context-variables-to-view-html-erb/3716
**Category:** Get Help
**Created:** [August 23, 2024, 3:55pm UTC](https://discourse.openondemand.org/t/passing-context-variables-to-view-html-erb/3716 "2024-08-23T15:55:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![wabrashear](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/wabrashear/32/2377_2.png) [@wabrashear](https://discourse.openondemand.org/u/wabrashear)
#### Post date: [August 23, 2024, 3:55pm UTC](https://discourse.openondemand.org/t/passing-context-variables-to-view-html-erb/3716/1 "2024-08-23T15:55:39Z")

</div>

I would like to change the form in view.html.erb based on user selection (launching either a jupyter notebook or R notebook). Is this possible?

---

<div class="post-metadata">

### Author: ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)
#### Post date: [August 23, 2024, 3:58pm UTC](https://discourse.openondemand.org/t/passing-context-variables-to-view-html-erb/3716/2 "2024-08-23T15:58:59Z")

</div>

You can use `conn_params`. The trick is to set an environment vairalbe that’ll be written back to the `connection.yml` file. Then if it’s in the `connection.yml` (like `password` or `host`) you can use it in the `view.html.erb`.

[https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/conn-params.html?highlight=conn\_params](https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/conn-params.html?highlight=conn_params)

---

<div class="post-metadata">

### Author: ![wabrashear](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/wabrashear/32/2377_2.png) [@wabrashear](https://discourse.openondemand.org/u/wabrashear)
#### Post date: [August 23, 2024, 4:00pm UTC](https://discourse.openondemand.org/t/passing-context-variables-to-view-html-erb/3716/3 "2024-08-23T16:00:43Z")

</div>

Thank you! I’ll give this a try.

---

<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: [February 19, 2025, 4:01pm UTC](https://discourse.openondemand.org/t/passing-context-variables-to-view-html-erb/3716/4 "2025-02-19T16:01:29Z")

</div>

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