Skip to content

Commit d6edd2e

Browse files
committed
Using morphing
This does not work—the h1-element does not get updated.
1 parent 69e58d8 commit d6edd2e

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

app/views/layouts/application.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta name="viewport" content="width=device-width,initial-scale=1">
66
<meta name="apple-mobile-web-app-capable" content="yes">
77
<meta name="mobile-web-app-capable" content="yes">
8+
<meta name="turbo-refresh-method" content="morph">
89
<%= csrf_meta_tags %>
910
<%= csp_meta_tag %>
1011

app/views/likes/create.turbo_stream.erb

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/views/likes/destroy.turbo_stream.erb

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/views/posts/show.html.erb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<main style="height: 300px; overflow-y: scroll">
22
<article style="margin-top: 50vh">
3-
<%= render partial: "title", locals: { post: @post } %>
3+
<h1>
4+
<%= @post.title %>
5+
(<%= pluralize(@post.likes.count, "like") %>)
6+
</h1>
47

58
<p>
69
<%= @post.content %>

0 commit comments

Comments
 (0)