Rails

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 26. 04. 2024
  • 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

Komentáƙe • 19

  • @mikopiko
    @mikopiko Pƙed 4 měsĂ­ci +4

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

  • @baowarrior4892
    @baowarrior4892 Pƙed 3 měsĂ­ci +3

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

  • @batterybikes
    @batterybikes Pƙed 3 měsĂ­ci +1

    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.

  • @ricardomordaunt1101
    @ricardomordaunt1101 Pƙed 4 měsĂ­ci +1

    Thank you

  • @haroldpepete
    @haroldpepete Pƙed 4 měsĂ­ci +1

    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

  • @precastdetailing
    @precastdetailing Pƙed měsĂ­cem

    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?

  • @azizdevfull
    @azizdevfull Pƙed 4 měsĂ­ci +1

    Useful : )

  • @fatihtas88
    @fatihtas88 Pƙed 4 měsĂ­ci

    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 Pƙed 4 měsĂ­ci

      did u restart the server after install it

    • @SupeRails
      @SupeRails  Pƙed 4 měsĂ­ci

      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 Pƙed 4 měsĂ­ci

      ​@@SupeRails проĐČДт у ĐŒĐ”ĐœŃ таĐș жД былО с ŃŃ‚ĐžĐŒ ĐżŃ€ĐŸĐ±Đ»Đ”ĐŒŃ‹ ĐżĐŸŃĐ»Đ” Ń‚ĐŸĐłĐŸ ĐșĐ°Đș ĐŸĐ±ĐœĐŸĐČОл ĐœĐ° pre.beta.2.

    • @okoni.alesre
      @okoni.alesre Pƙed 4 měsĂ­ci

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

    • @fatihtas88
      @fatihtas88 Pƙed 3 měsĂ­ci

      ​@@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-cj7wj Pƙed 3 měsĂ­ci

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

    • @SupeRails
      @SupeRails  Pƙed 3 měsĂ­ci +1

      Thanks for the feedback! I will try to improve