Skip to content

Instantly share code, notes, and snippets.

@donrestarone
Created December 25, 2020 15:18
Show Gist options
  • Save donrestarone/b6dbd042ba63b24100698c8d3d1eae09 to your computer and use it in GitHub Desktop.
Save donrestarone/b6dbd042ba63b24100698c8d3d1eae09 to your computer and use it in GitHub Desktop.
hotwire demo rails 6
class Tweet < ApplicationRecord
has_rich_text :content
after_create_commit {broadcast_prepend_to "tweets"}
after_update_commit {broadcast_replace_to "tweets"}
after_destroy_commit {broadcast_remove_to "tweets"}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment