Rails Turbo Frame principles

  • If I have a turbo-frame element with an id and I send a request from anything inside that element, response should include another turbo-frame element with the same id and based on the action on the response attributes of the turbo-frame element, the original turbo-frame element will get replaced, removed, appended.
  • If there is no matching turbo-frame with the same id as the request, the original turbo-frame element will be removed.
  • Adding _top to the turbo-frame will stop turbo niceties and replace the whole page.
  • turbo-frame are simplistic in nature, They cannot update outside of their context. For example, if there are multiple turbo-frames with ids turbo-frame-1 and turbo-frame-2, requests from turbo-frame-1 cannot update anything inside turbo-frame-2. I may have look at turbo-stream for this or stimulus
  • If I have a turbo-frame with an id and then another link with data-turbo-frame set to the id, clicking on the link will load contents for the turbo-frame.
  • I still don’t know how the url changes in turbo-frame interactions.

Leave a comment