Skip to content

Commit ddc361f

Browse files
committed
Mention the remove accepts a string
1 parent df1caea commit ddc361f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ There are 5 _actions_ in Turbo Streams. They are:
242242
* `append` & `prepend`: to add the elements in the target element after the existing contents or before, respectively
243243
* `replace`: will replace the existing element entirely with the contents of the `template` tag in the Turbo Stream
244244
* `update`: will keep the target and only replace the contents of it with the contents of the `template` tag in the Turbo Stream
245-
* `remove`: will remove the element. This one doesn't need a `<template>` tag.
245+
* `remove`: will remove the element. This one doesn't need a `<template>` tag. It accepts either an instance of a Model or the DOM ID of the element to be removed as a string.
246246

247247
Which means you will find shorthand methods for them all, like:
248248

@@ -645,7 +645,6 @@ public function store()
645645

646646
You may also catch the `ValidationException` and return a non-200 response, if you want to.
647647

648-
649648
<a name="turbo-native"></a>
650649
### Turbo Native
651650

@@ -744,7 +743,7 @@ class CreatesCommentsTest extends TestCase
744743
}
745744
```
746745

747-
**Note: make sure your `turbo-laravel.queue` config key is set to false, otherwise actions may not be dispatched during test because the model observer only fires them after the transaction is commited, which never happens in tests since they run inside a transaction.**
746+
*Note: make sure your `turbo-laravel.queue` config key is set to false, otherwise actions may not be dispatched during test because the model observer only fires them after the transaction is commited, which never happens in tests since they run inside a transaction.*
748747

749748
<a name="closing-notes"></a>
750749
### Closing Notes

0 commit comments

Comments
 (0)