Skip to content

Commit

Permalink
Ruby snippet using #redirect(new_path)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismasan committed Feb 4, 2025
1 parent 4c071c6 commit e9c23ae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions site/static/code_snippets/how_tos/redirect_3.rubysnippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
datastar = Datastar.new(request:, response:)

datastar.stream do |sse|
sse.merge_fragments '<div id="indicator">Redirecting in 3 seconds...</div>'

sleep 3

sse.redirect '/guide'
end

0 comments on commit e9c23ae

Please sign in to comment.