Skip to content

Instantly share code, notes, and snippets.

@khash
Last active February 12, 2021 05:59
Show Gist options
  • Save khash/15e93b4f4b51f4b6469501d73f146641 to your computer and use it in GitHub Desktop.
Save khash/15e93b4f4b51f4b6469501d73f146641 to your computer and use it in GitHub Desktop.
Rails Turbo Streams
<%= turbo_frame_tag dom_id(stock) do %>
<%= stock.ticker %> is <%= stock.price %>
<% end %>
<%= turbo_stream_from @stock %>
<%= render 'stock', stock: @stock %>
class Stock < ActiveRecord
#...
broadcasts
#...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment