Skip to content

Commit 1296cec

Browse files
authored
Document host dashboard extensions and reference in view (#982)
## Summary - document how host apps can inject custom resources into the host dashboard via a `_host_app_resources` partial - reference the new doc from the host dashboard view ## Testing - `bundle install` *(failed: Your Ruby version is 3.2.3, but your Gemfile specified 3.4.4)* - `bin/ci` *(failed: bundler: command not found: rails)* - `bundle exec rubocop` *(failed: bundler: command not found: rubocop)* - `bundle exec brakeman -q -w2` *(failed: bundler: command not found: brakeman)* - `bundle exec bundler-audit --update` *(failed: bundler: command not found: bundler-audit)* - `bin/codex_style_guard` *(failed: bundler: command not found: rubocop)* ------ https://chatgpt.com/codex/tasks/task_e_689a5b7a3f2c83219e744f552ea3a056
2 parents d285fda + 53207ac commit 1296cec

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

app/views/better_together/host_dashboard/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="container my-3">
66
<h1>Dashboard</h1>
77

8-
<!-- Custom section for the host app -->
8+
<!-- Custom section for the host app. See docs/host_dashboard_extensions.md for details. -->
99
<%= render partial: 'host_app_resources' %>
1010

1111
<!-- Better Together Resources Section -->

docs/host_dashboard_extensions.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Host Dashboard Extensions
2+
3+
The host dashboard provided by Better Together includes a hook for host applications to display custom resources.
4+
5+
To add your own content, create the following partial in your host application:
6+
7+
```
8+
app/views/better_together/host_dashboard/_host_app_resources.html.erb
9+
```
10+
11+
Any markup placed in this partial will be rendered near the top of the dashboard. This is useful for linking to admin areas or providing host-specific information.
12+
13+
Example:
14+
15+
```erb
16+
<!-- host app: app/views/better_together/host_dashboard/_host_app_resources.html.erb -->
17+
<div class="row my-4">
18+
<div class="col">
19+
<%= link_to 'My Custom Admin Area', my_custom_path, class: 'btn btn-primary' %>
20+
</div>
21+
</div>
22+
```
23+
24+
If the partial is absent, the dashboard simply skips this section.

0 commit comments

Comments
 (0)