Refactoring Turbo Streams into Turbo Frames
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
Great tutorial! Only complaint is that you didnt make this 2 weeks earlier when I had to do this at work 😜
Hahahaha! So close!
It was really informative,
Thank you ❤
Thanks for watching!!
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]}.