Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[demo-3]Turbo Streamsを使って二箇所を更新する #10

Open
wants to merge 2 commits into
base: 2-use-frame
Choose a base branch
from

Conversation

yakitorii
Copy link
Member

@yakitorii yakitorii commented Dec 12, 2022

やったこと

  • create時にTurob Streamsによる、二箇所のシームレスな変更
  • create成功時にturbo_stream.updateによるFlashメッセージの表示

確認方法

  • 失敗時にエラーが表示される

image

  • 成功時にflushメッセージと一覧が更新される

image

まだやってないこと

  • Websocketを利用した変更即時反映

公式ドキュメント

Turbo Reference:Streams

Turbo Handbook:Come Alive with Turbo Streams

@@ -0,0 +1,13 @@
<%= turbo_stream.update "flash" do %>
<%= render partial: "layouts/flash" %>
<% end %>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

初心者向けの分かりやすさのために省略記法を使わずに記述しています.

@yakitorii yakitorii changed the title [demo-3]Streamを使って二箇所を更新する [demo-3]Turbo Streamsを使って二箇所を更新する Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant