...

/

Navigating Outside a Turbo Frame

Navigating Outside a Turbo Frame

Learn to enable a link inside the Turbo Frame to change the parts of the webpage that lie outside it.

Problems in the Previous App

Clicking around the schedule page after adding the edit functionality shows that we moved fast and broke things. Specifically, the links on each concert name that leads to the concert’s page and the “Make Favorite” button appear to be broken. Clicking the concert name does nothing but make the concert display disappear and clicking the “Make Favorite” button updates the concert display but not the “Favorites” section.

Both of these problems have the same cause: the links are now inside a Turbo Frame but try to change parts of the page outside that frame. Turbo Frames, by default, only capture the part of the response that matches the ID of the Turbo Frame that the request came from. In the case of the concert name link, there is no corresponding Turbo Frame, so the ...