Created
December 25, 2020 15:18
-
-
Save donrestarone/b6dbd042ba63b24100698c8d3d1eae09 to your computer and use it in GitHub Desktop.
hotwire demo rails 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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