DEV Community

Cover image for Disable Turbo on the whole application
Ken Obara
Ken Obara

Posted on • Edited on

1

Disable Turbo on the whole application

I am working on "The Turbo Rails Tutorial".

Problem

In Chapter 7, I can't disable Turbo on the whole application only by writing the below. For example, when I push the submit button it won't return to the homepage.

// app/javascript/application.js
import { Turbo } from "@hotwired/turbo-rails"
Turbo.session.drive = false
Enter fullscreen mode Exit fullscreen mode

Solution

The rule would be changed a bit from Turbo 7.2.x. We can add data-turbo="false" to the tag and disable Turbo.

// app/views/layouts/application.html.erb
<body data-turbo="false">
Enter fullscreen mode Exit fullscreen mode

Reference

https://github.com/hotwired/turbo/issues/826

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post