0

I have a response that has a template with 3 different turbo_tags nested in another one.

= turbo_frame_tag 'container'
  = turbo_frame_tag 'frame1'
    = form_with url: path, data: { turbo_frame: '?' }
  = turbo_frame_tag 'frame2'
  = turbo_frame_tag 'frame3'

I want my form submission to render the same view and update the frame1 and frame3 to get updated but not the frame2. Is that possible? what should I set on turbo_frame attribute?

  • I'm not sure that you can target multiple frames by id - but you can use the `targets` attribute with a CSS selector. https://turbo.hotwired.dev/reference/streams#targeting-multiple-elements – max Jun 08 '22 at 15:00
  • That CSS selector can be a list of ids "#frame1, #frame2" or you can add classes to the frames you want to target. – max Jun 09 '22 at 09:20
  • currently it can't be done you need to target _top and replace them all, https://github.com/hotwired/turbo/issues/56#issuecomment-752632522 and https://github.com/hotwired/turbo/issues/475 – buncis Aug 28 '22 at 16:07

0 Answers0