Part of the Hotwire and Rails collection on web-crunch.com
In this guide, I aim to help you showcase the popularity of blog posts by adding real-time likes as a polymorphic feature to your Rails app using hotwired.dev and the Turbo framework. Follow this step-by-step guide to set up models, associations, and implement real-time liking functionality.
I'll use my new project called Rails UI alongside this guide, as it solves many of the early (and later) design problems for a typical Rails application. You're free to not use Rails UI, but you'll need to install and configure Devise (or a similar user authentication library) to achieve similar results.
https://web-crunch.com/posts/adding-likes-rails-hotwire-turbo
https://github.com/justalever/likes_hotwire
All the links:
- https://railsui.com - Latest project
- https://web-crunch.com - My long running blog/publication
- Web-Crunch on X
- Rails UI on X
- Personal on X