Mid-level Track Roadmap

Hotwire: advanced Turbo Frames

This course covers advanced Turbo Frames through the frames on one app's admin and notes pages. It shows several frames on a single page with dynamic ids, and why those ids must be unique. It explains leaving a frame for the whole page with _top, targeting a frame by name, and adding browser history with turbo_action. Forms follow the same targeting rules as links. The last lessons cover what Turbo does when a response lacks the expected frame, and how to read a frame-heavy page.

What you'll learn

  • ✓Rendering several frames on one page with dynamic, unique ids
  • ✓Leaving a frame for the whole page with the reserved _top target
  • ✓Targeting a frame elsewhere on the page by its id
  • ✓Adding or replacing a browser history entry with turbo_action advance or replace
  • ✓Applying the same frame targeting rules to forms
  • ✓How Turbo handles a response missing the expected frame
Free preview · Lesson 1 3 min read

Many frames, one page

In the junior-level course "Hotwire: Turbo Drive & Frames", each frame example had one job on its page: the lesson editor's image section, the discussion thread. Nothing says a page can have only one. This app's admin course list has four independent frames on the same page, one per level, and each…

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...