User Tools

Site Tools


ruby

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
ruby [2026/03/15 19:37] – Using Turbo Frames reddyruby [2026/03/15 19:56] (current) reddy
Line 94: Line 94:
 </code> </code>
  
 +==== Turbo Streams ====
  
 +<code>
 +# In the view
 +<%= turbo_stream_from "src_1" %>
 +<div id="divvy_1"></div>
 +
 +# In a controller
 +Turbo::StreamsChannel.broadcast_update_to(
 +  'src_1',
 +  target: 'divvy_1',
 +  content: DateTime.now  # html: render ...
 +)
 +</code>
  
ruby.1773599836.txt.gz · Last modified: by reddy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki