ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Rails 7

ruby

rails

ruby on rails

tutorial

programming

kredis

hotwire turbo

actioncable

live update

redis

live counter

websockets

Автор: SupeRails

Загружено: 2023-02-22

Просмотров: 1235

Описание: In the two previous episodes we use Kredis to store website visitors and users online. Let's dive deeper into what Kredis is and other ways we can use it!

Redis is now baked into Rails by default.
Kredis let's you easily save and retrieve data from Redis.
Killer feature of Kredis - reference ActiveRecord objects with Redis attributes.
For example - sstore User "preferences" in Redis, not Postgresql.
There are a lot of usecases for Kredis, and in this video I explore just a few.

In THIS episode we will build a counter with a PLUS and MINUS button.
When clicked, the two buttons will be able to increase or decrease the counter respectively.
We will also use Turbo Streams to update the counter without having to refresh the page.
We will compare HTTP turbo streams that send updates only in the window where the action happened, with turbo stream broadcasts, that send updates to ALL the clients that have a page open.

Episode source code: https://github.com/corsego/113-kredis...
Blogpost - kredis overview: https://blog.corsego.com/gem-kredis-i...

0:00 Redis in Rails 7
1:09 install Kredis
1:39 use Kredis from Rails console, Kredis list (array)
2:30 Kredis unique list (array)
3:26 Kredis counter (integer)
3:54 display Kredis counter in Rails view
5:58 button to increment counter
7:16 button to decrement counter
8:05 refresh counter with HTTP Turbo Streams
11:20 push live counter updates with Turbo Stream Broadcasts that use ActionCable and Websockets
13:30 Works! Counter gets updated in all browser windows!

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Rails 7

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]