Skip to content

Instantly share code, notes, and snippets.

@catmando
Created February 26, 2021 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catmando/507449a815765b7160e6fe72e4e7e0c7 to your computer and use it in GitHub Desktop.
Save catmando/507449a815765b7160e6fe72e4e7e0c7 to your computer and use it in GitHub Desktop.
Hyperstack vs Hotwire twitter.rb
class Tweet < ApplicationRecord
after_create_commit { broadcast_prepend_to "tweets" }
after_update_commit { broadcast_replace_to "tweets" }
after_destroy_commit { broadcast_remove_to "tweets" }
validates :body, presence: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment