The BEST way to build Infinite Scroll using Hotwire

  Рет қаралды 1,374

Rapid Ruby

Rapid Ruby

Жыл бұрын

Follow along as I implement infinite scroll pagination on the rapidruby.com lessons page. I’ll be using the useIntersection helper from stimulus-use to detect when you have scrolled to the bottom of the page and then Turbo Streams to insert each new block of videos.
Some of the libraries used in this video:
- stimulus-use (useIntersection): stimulus-use.github.io/stimul...
- Kaminari: github.com/kaminari/kaminari
- Rails request.js: github.com/rails/request.js
And you can find a gist of the code here:
gist.github.com/phawk/cbdb48a...
P.s. Want access to next week's video right now? Head on over and sign up on rapidruby.com now!
---
Has this video helped you out? Consider buying me a coffee to say thanks and support future content like this, thanks!
app.payhere.co/rapid-ruby/buy...
You can also find more content like this, including premium courses and exclusive community and mentorship to help you level-up! Head over to rapidruby.com and use the code RRKZbin for a discount!

Пікірлер: 13
@joey2545
@joey2545 Жыл бұрын
Very cool! Thanks for making this quick video!
@midda7
@midda7 Жыл бұрын
thanks a lot!
@Alimenteocerebro
@Alimenteocerebro 10 ай бұрын
I couldn't pass the value to the controller. I added the div as you said, but doing a console.log I see that this.urlValue returns empty. Is there any logic for javascript to get the values?
@notrab
@notrab Жыл бұрын
Great video!
@dencam
@dencam Жыл бұрын
Awesome video, Thank you please.
@azizdevfull
@azizdevfull Жыл бұрын
very Helpful : )
@AntonLitvinenko
@AntonLitvinenko Жыл бұрын
Hi! Any reason you arent using a lazy turbo frame to load the next page?
@rapid-ruby
@rapid-ruby Жыл бұрын
Hi Anton, yes, this is an approach I’ve used before, and it has a lot of issues to work around. On the surface it works, but when you load a few pages, go to a new page, and then press the back button in your browser, you’ll see a lot of weird things happening.
@AntonLitvinenko
@AntonLitvinenko Жыл бұрын
Ok! Will pay attention to that! Thank you!
@rahulk6130
@rahulk6130 Жыл бұрын
Nice video. Would appreciate if you would increase / zoom your editor a bit, so the font is larger. Thanks.
@rapid-ruby
@rapid-ruby Жыл бұрын
Thanks for the suggestion, I’ll keep that in mind! I’ve already recorded a bunch of videos, so if you don’t see an increase for a while, that’s why :)
@tkhobbes
@tkhobbes Жыл бұрын
Any reason for choosing kaminary over pagy?
@rapid-ruby
@rapid-ruby Жыл бұрын
Not really, I’ve just used kaminari for years at the point and it does everything I need 😅
Turbo Frames vs. Turbo Streams
8:25
Mix & Go
Рет қаралды 16 М.
Balloon Pop Racing Is INTENSE!!!
01:00
A4
Рет қаралды 16 МЛН
How To Choose Ramen Date Night 🍜
00:58
Jojo Sim
Рет қаралды 58 МЛН
NO NO NO YES! (50 MLN SUBSCRIBERS CHALLENGE!) #shorts
00:26
PANDA BOI
Рет қаралды 93 МЛН
Infinite Scroll with Rails and Turbo  - No JavaScript
15:29
webcrunch
Рет қаралды 1,2 М.
Moving away from importmaps to esbuild in Rails 7
9:27
Rapid Ruby
Рет қаралды 4 М.
Three.js For 3D Portfolios And GAMES With Rails 7
27:22
Deanin
Рет қаралды 3,6 М.
ChatGPT Can Now Talk Like a Human [Latest Updates]
22:21
ColdFusion
Рет қаралды 350 М.
the new PS4 jailbreak is sort of hilarious
12:21
Low Level Learning
Рет қаралды 406 М.
ASMR Programming - Weather App With Javascript - No Talking
20:30
AsmrProg
Рет қаралды 2,6 МЛН
Ruby on Rails | Building a weather app
40:03
TypeFast
Рет қаралды 7 М.
Hotwire: The Demo
12:55
Getting Real
Рет қаралды 37 М.
Apple. 10 Интересных Фактов
24:26
Dameoz
Рет қаралды 107 М.
Vortex Cannon vs Drone
20:44
Mark Rober
Рет қаралды 14 МЛН
#Shorts Good idea for testing to show.
0:17
RAIN Gadgets
Рет қаралды 3,6 МЛН