Skip to content

Commit

Permalink
Turbo を v7.1.0 にし、TurboFrame の遷移後に URL を自動で書き換えてくれるようにした
Browse files Browse the repository at this point in the history
data-turbo-frame で遷移した場合、URL は着替えてくれない
それだと不便なことがあるため URL を書き換えてくれる advance モードを利用する
v7.1.0 から <a> タグ単体でも機能するようになったのでアップグレードした
hotwired/turbo#398
  • Loading branch information
zaru committed Nov 25, 2021
1 parent 93a5240 commit 9856c14
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ GEM
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
bindex (0.8.1)
bootsnap (1.9.1)
bootsnap (1.9.3)
msgpack (~> 1.0)
builder (3.2.4)
byebug (11.1.3)
Expand All @@ -81,7 +81,7 @@ GEM
crass (1.0.6)
erubi (1.10.0)
ffi (1.15.4)
globalid (0.5.2)
globalid (0.6.0)
activesupport (>= 5.0)
hotwire-rails (0.1.3)
rails (>= 6.0.0)
Expand Down Expand Up @@ -177,11 +177,11 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
stimulus-rails (0.7.2)
stimulus-rails (0.7.3)
rails (>= 6.0.0)
thor (1.1.0)
tilt (2.0.10)
turbo-rails (0.8.3)
turbo-rails (0.9.0)
rails (>= 6.0.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
Expand Down
2 changes: 1 addition & 1 deletion app/views/articles/_article.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<td><%= article.title %></td>
<td><%= article.content %></td>
<td><%= link_to 'Show', article %></td>
<td><%= link_to 'Edit', edit_article_path(article), data: { turbo_frame: 'article_form' } %></td>
<td><%= link_to 'Edit', edit_article_path(article), data: { turbo_frame: 'article_form', turbo_action: 'advance' } %></td>
<td><%= link_to 'Destroy', article, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
28 changes: 14 additions & 14 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9856c14

Please sign in to comment.