Refactoring Turbo Streams into Turbo Frames

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 5

  • @prakashsanyasi5608
    @prakashsanyasi5608 Рік тому +2

    It was really informative,
    Thank you ❤

  • @rmjones15
    @rmjones15 Рік тому +5

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

  • @BenjaminBrunner-c9o
    @BenjaminBrunner-c9o Рік тому

    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]}.