|
1 | 1 | # Resource Toolbar |
2 | 2 |
|
3 | | -A shared partial for rendering edit, preview, and destroy buttons for a resource. |
| 3 | +A shared partial for rendering edit, view, and destroy buttons for a resource. |
4 | 4 |
|
5 | 5 | ## Usage |
6 | 6 |
|
7 | 7 | ``` |
8 | 8 | <%= render 'shared/resource_toolbar', |
9 | 9 | edit_path: edit_post_path(@post), |
10 | | - preview_path: preview_post_path(@post), |
| 10 | + view_path: post_path(@post), |
11 | 11 | destroy_path: post_path(@post), |
12 | 12 | destroy_confirm: t('globals.confirm_delete'), |
13 | 13 | edit_aria_label: 'Edit Post', |
14 | | - preview_aria_label: 'Preview Post', |
| 14 | + view_aria_label: 'View Post', |
15 | 15 | destroy_aria_label: 'Delete Post' %> |
16 | 16 | ``` |
17 | 17 |
|
18 | 18 | ## Locals |
19 | 19 |
|
20 | 20 | - `edit_path` – link for the edit action (optional) |
21 | | -- `preview_path` – link for the preview action (optional) |
| 21 | +- `view_path` – link for the view action (optional) |
22 | 22 | - `destroy_path` – link for the destroy action (optional) |
23 | 23 | - `destroy_confirm` – confirmation text for destroy (defaults to `t('globals.confirm_delete')`) |
24 | | -- `edit_aria_label`, `preview_aria_label`, `destroy_aria_label` – ARIA labels for accessibility. |
| 24 | +- `edit_aria_label`, `view_aria_label`, `destroy_aria_label` – ARIA labels for accessibility. |
25 | 25 |
|
26 | 26 | Buttons render only when the corresponding path is provided. Defaults use the global translations for button text and ARIA labels. |
0 commit comments