Refactoring Turbo Streams into Turbo Frames

Sdílet
Vložit
  • čas přidán 28. 05. 2024
  • ► Check out gorails.com for Pro episodes and more!
    ► SaaS business template for Ruby on Rails with built-in features like Payments, Teams, and much more: jumpstartrails.com
    ► Ruby on Rails hosting with Hatchbox.io: hatchbox.io
    ► Learn how to add Stripe Payments (with SCA support!) with Ruby on Rails: courses.gorails.com/payments-...
  • Věda a technologie

Komentáře • 5

  • @rmjones15
    @rmjones15 Před 10 měsíci +4

    Great tutorial! Only complaint is that you didnt make this 2 weeks earlier when I had to do this at work 😜

  • @prakashsanyasi5608
    @prakashsanyasi5608 Před 10 měsíci +2

    It was really informative,
    Thank you ❤

  • @user-kn3ob5nx4h
    @user-kn3ob5nx4h Před 10 měsíci

    Hey, great tutorial, only problem is, without the respond_to format.turbo_stream in the controller, it seems that Rails is looking for a partial with a format type of turbo_stream, not html... So I had to put this in the controller , which defeats the point of Turbo-frame magic :/
    respond_to do |format|
    format.turbo_stream do
    render turbo_stream:
    turbo_stream.replace(
    "file", partial: "mypartial"
    )
    end
    end
    Other wise I had the error :
    Missing partial /mypartial with {:locale=>[:fr, :en], :formats=>[:turbo_stream], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :arb]}.