Rails

Sdílet
Vložit
  • čas přidán 7. 05. 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 4 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 4 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.

  • @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

  • @ricardomordaunt1101
    @ricardomordaunt1101 Před 4 měsíci +1

    Thank you

  • @azizdevfull
    @azizdevfull Před 4 měsíci +1

    Useful : )

  • @precastdetailing
    @precastdetailing Před 2 měsíci

    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
    @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 4 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 4 měsíci

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

    • @SupeRails
      @SupeRails  Před 4 měsíci +1

      Thanks for the feedback! I will try to improve