Rails

Turbo 8 adds a new technique of sending HTML over the wire: "refresh current page, preserve scroll".
This new approach opens EASYER ways to render elements on current page without passing too much context to TurboStreams.
👮‍♂️ however there some tricky scenarios that you should be aware of! 🚨
Level 1: We will try using PageRefreshes on a new Rails app.
Level 2: Use page refreshes to live-update nested comments in a real app.
Get access to superails.com source code:
1. Sign in to superails.com with Github
2. Leave a comment under the video superails.com/posts/rails-156...
Episode source code: github.com/corsego/156-turbo8...
Based on this blogpost: blog.corsego.com/hotwire-turb...
0:00 Turbo 8 intro
2:44 Update Table with TurboStreams
6:10 Install Turbo8, enable morphing
10:16 preserve some elements after morph
11:46 live updates
16:18 Turbo Morphing in a real app

Пікірлер: 19

  • @mikopiko
    @mikopiko4 ай бұрын

    This is such a powerful feature, so we can now make pages interactive with no SPA.

  • @baowarrior4892
    @baowarrior48924 ай бұрын

    THANK GOD I decided to go all in with rails and leave react and vue behind this is amazing!

  • @batterybikes
    @batterybikes4 ай бұрын

    This is so great man. I love seeing Turbo 8 used incrementally and across so many contexts. Thanks so much for your time and explanations for all of this. I look forward to trying this out asap.

  • @haroldpepete
    @haroldpepete4 ай бұрын

    great video, you never let me down, all that stuff arround morpho is making a lot of noise, it's good to know what is the real benefit, i think morpho's a great feature that make turbo ecosystem even better

  • @ricardomordaunt1101
    @ricardomordaunt11014 ай бұрын

    Thank you

  • @azizdevfull
    @azizdevfull4 ай бұрын

    Useful : )

  • @precastdetailing
    @precastdetailing2 ай бұрын

    Hey thanks for the video (turbo morphing video). In it you have to add the turbo_refreshes_with method within the HEAD tag. But you have also added "yield :head" -----> is this really necessary for morphing?

  • @fatihtas88
    @fatihtas884 ай бұрын

    well, my turbo_refreshes_with method: :morph, scroll: :preserve line doesn't work. i keep getting full refresh with scroll reset. any idea why

  • @TheVimeo

    @TheVimeo

    4 ай бұрын

    did u restart the server after install it

  • @SupeRails

    @SupeRails

    4 ай бұрын

    1) are you sure you also add the “yield” in the head? 2) are you sure you are using gem turbo-rails v2beta?

  • @okoni.alesre

    @okoni.alesre

    4 ай бұрын

    ​@@SupeRails привет у меня так же были с этим проблемы после того как обновил на pre.beta.2.

  • @okoni.alesre

    @okoni.alesre

    4 ай бұрын

    ​@@SupeRails turbo_refreshes_with method: :morph, scroll: :preserve

  • @fatihtas88

    @fatihtas88

    4 ай бұрын

    ​@@TheVimeo yes certainly. it still does not work. I am submitting my form via stimilus. Thats the only difference, and i havent been able to solve it yet

  • @NiKo-cj7wj
    @NiKo-cj7wj4 ай бұрын

    Do you realize that you can‘t put two sentences together without saying „eHh“?

  • @SupeRails

    @SupeRails

    4 ай бұрын

    Thanks for the feedback! I will try to improve