Skip to content

Commit 86c1ee4

Browse files
committed
Change examples to use subfolder partials instead of underscore
1 parent fcaa0e0 commit 86c1ee4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/helpers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ If you're rendering a Turbo Stream inside a your Blade files, you may use the `<
5454

5555
```blade
5656
<x-turbo::stream :target="$post" action="update">
57-
@include('posts._post', ['post' => $post])
57+
@include('posts.partials.post', ['post' => $post])
5858
<x-turbo::stream>
5959
```
6060

docs/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class CreatesCommentsTest extends TestCase
247247
TurboStream::assertBroadcasted(function (PendingBroadcast $broadcast) use ($todo) {
248248
return $broadcast->target === 'comments'
249249
&& $broadcast->action === 'append'
250-
&& $broadcast->partialView === 'comments._comment'
250+
&& $broadcast->partialView === 'comments.partials.comment'
251251
&& $broadcast->partialData['comment']->is($todo->comments->first())
252252
&& count($broadcast->channels) === 1
253253
&& $broadcast->channels[0]->name === sprintf('private-%s', $todo->broadcastChannel());

docs/turbo-streams.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Although it's handy to pass a model instance to the `turbo_stream()` function -
6262
turbo_stream()
6363
->target('comments')
6464
->action('append')
65-
->view('comments._comment', ['comment' => $comment]);
65+
->view('comments.partials.comment', ['comment' => $comment]);
6666
```
6767

6868
There are also shorthand methods which may be used as well:
@@ -122,7 +122,7 @@ For both the `before` and `after` methods you need additional calls to specify t
122122
```php
123123
turbo_stream()
124124
->before($comment)
125-
->view('comments._flash_message', [
125+
->view('comments.partials.flash_message', [
126126
'message' => __('Comment created!'),
127127
]);
128128
```
@@ -199,7 +199,7 @@ When creating Turbo Streams using the builders, you may also specify the CSS cla
199199
turbo_stream()
200200
->targets('.comment')
201201
->action('append')
202-
->view('comments._comment', ['comment' => $comment]);
202+
->view('comments.partials.comment', ['comment' => $comment]);
203203
```
204204

205205
## Turbo Stream Macros
@@ -281,7 +281,7 @@ return turbo_stream([
281281
->append($comment)
282282
->target(dom_id($comment->post, 'comments')),
283283
turbo_stream()
284-
->update(dom_id($comment->post, 'comments_count'), view('posts._comments_count', [
284+
->update(dom_id($comment->post, 'comments_count'), view('posts.partials.comments_count', [
285285
'post' => $comment->post,
286286
])),
287287
]);
@@ -308,7 +308,7 @@ Here's an example of a more complex custom Turbo Stream view:
308308
309309
<turbo-stream target="@domid($comment->post, 'comments')" action="append">
310310
<template>
311-
@include('comments._comment', ['comment' => $comment])
311+
@include('comments.partials.comment', ['comment' => $comment])
312312
</template>
313313
</turbo-stream>
314314
```
@@ -319,7 +319,7 @@ Remember, these are Blade views, so you have the full power of Blade at your han
319319
@if (session()->has('status'))
320320
<turbo-stream target="notice" action="append">
321321
<template>
322-
@include('layouts._flash')
322+
@include('layouts.partials.flash')
323323
</template>
324324
</turbo-stream>
325325
@endif
@@ -331,7 +331,7 @@ Similar to the `<x-turbo::frame>` Blade component, there's also a `<x-turbo::str
331331
@include('layouts.turbo.flash_stream')
332332
333333
<x-turbo::stream :target="[$comment->post, 'comments']" action="append">
334-
@include('comments._comment', ['comment' => $comment])
334+
@include('comments.partials.comment', ['comment' => $comment])
335335
</x-turbo::stream>
336336
```
337337

0 commit comments

Comments
 (0)