Infinite Scroll with Rails and Turbo 8 - No JavaScript
Web-Crunch
In this video tutorial, I will walk you through the process of creating an infinite scroll feature using Rails and Turbo 8. I wanted to see if using only Turbo was an option for this feature and turns out, it is! I was excited to discover this so I wanted to share the wealth.
I will cover the necessary steps, including setting up the database and handling the server-side logic. By the end of this guide, you will have a fully functional infinite scroll feature in your Rails application that you can borrow on your own.
Timestamps: 00:23 - Demo of what we are building 01:50 - Create a new Rails app 02:23 - Add gem dependencies 03:29 - Install Tailwind CSS 04:00 - Generate Post scaffold 04:52 - Use Faker gem and seeds to generate dummy data 07:01 - Update the root route 07:32 - Quick UI tweaks to post feed styles with Tailwind CSS 08:10 - Add pagination in the posts controller with will_paginate 09:15 - Begin coding with Turbo_frames and streams in the posts index view 12:14 - Add index.turbo_stream.erb file and logic 14:10 - Testing it all out
======
š I'm Andy Leverenz, a passionate product designer and developer. I love creating and sharing my knowledge through design, coding, and writing. Join me on my journey by checking out my blog, Web-Crunch (https://webcrunch.com), where I publish tutorials, articles, and the occasional vlog about design and development.
š° Never miss an update! Click here to subscribe: https://www.youtube.com/user/webcrunch?sub_confirmation=1
š» Read the written version: https://webcrunch.com/posts/infinite-scroll-rails-turbo
š New to Ruby on Rails? Enroll in my course HELLO RAILS: https://hellorails.io
š» The Blog (my source of truth): https://webcrunch.com
Additional Links: šØ Bring life to Rails projects with Rails UI: https://railsui.com. šØāš» Hire me: Visit: https://railsui.com/custom š¤ https://twitter.com/webcrunchblog. āļø https://github.com/justalever.
P.S. This stuff takes a long time to make but I love to do it. To help me keep at it consider supporting me. If not monetarily, then subscribe to the channel or share it with someone!
⨠https://github.com/sponsors/justalever āļø https://www.buymeacoffee.com/webcrunch ... https://www.youtube.com/watch?v=F63GgJSYE9I
67200432 Bytes