Skip to content

Commit

Permalink
add render to menu editor
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Jan 27, 2024
1 parent c3af835 commit 4542f99
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/3.0/menu-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ A few menu item types are supported `link_to`, `section`, `group`, `resource`, a

:::option `link_to`

Link to is the menu item that the user will probably interact with the most. It will generate a link on your menu. You can specify the `name`, `path` , and `target`.
`link_to` is the menu item that the user will probably interact with the most. It will generate a link on your menu. You can specify the `name`, `path` , and `target`.

```ruby
link_to "Google", path: "https://google.com", target: :_blank
Expand All @@ -100,7 +100,19 @@ link_to "Google", path: "https://google.com", target: :_blank
<img :src="('/assets/img/menu-editor/external-link.jpg')" alt="Avo menu editor" class="border mb-4" />

When you add the `target: :_blank` option, a tiny external link icon will be displayed.
:::

:::option `render`
The `render` method will render renderable objects like partials or View Components.

You can even pass `locals` to partials.
The partials follow the same pattern as the regular `render` method.

```ruby
render "avo/sidebar/items/custom_tool"
render "avo/sidebar/items/custom_tool", locals: { something: :here }
render Super::Dooper::Component.new(something: :here)
```
:::

:::option `resource`
Expand Down

0 comments on commit 4542f99

Please sign in to comment.