// app/javascript/application.js
import "@hotwired/turbo-rails"
import "controllers"
import "trix"
import "@rails/actiontext"
import Rails from "@rails/ujs"
Rails.start()
# config/importmap.rb
# Pin npm packages by running ./bin/importmap
pin "application", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin_all_from "app/javascript/controllers", under: "controllers"
pin "trix"
pin "@rails/actiontext", to: "actiontext.js"
pin "@rails/ujs", to: "https://ga.jspm.io/npm:@rails/[email protected]/lib/assets/compiled/rails-ujs.js"
For example in code I have:
= link_to 'Sing Out', destroy_user_session_path, method: :delete, data:{turbo: false}
when I clicked Sing out
i.e. new views coming from root_path are added. Turbo: false doesn't fix.
What I mean:
I can turn off turbo(like below) and then redirect work correctly:
// app/javascript/application.js
//import "@hotwired/turbo-rails"
import "controllers"
import "trix"
import "@rails/actiontext"
import Rails from "@rails/ujs"
Rails.start()
I also tried something like below, but it didn't help:
class ApplicationController < ActionController::Base
..................................................................
def after_sign_out_path_for(resource_or_scope)
disable_turbo
root_path
end
def disable_turbo
response.set_header("Turbo-Frame", "_top")
end
end
What is the problem with the turbo?