diff --git a/README.md b/README.md index 0f1a43568..43f43af16 100644 --- a/README.md +++ b/README.md @@ -129,10 +129,13 @@ Configures the default Rake task to audit and lint the codebase with ### Views Configures flash messages, page titles via the [title][] gem, and sets the -document [lang][]. +document [lang][]. Disables Turbo's [InstantClick][] to account for page +requests that are [not debounced][]. [title]: https://github.com/calebhearth/title [lang]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang +[InstantClick]: https://turbo.hotwired.dev/handbook/drive#prefetching-links-on-hover +[not debounced]: https://github.com/hotwired/turbo/pull/1181#issuecomment-1936505362 ### Setup diff --git a/lib/generators/suspenders/views_generator.rb b/lib/generators/suspenders/views_generator.rb index 9fb392a2b..2c3d14a0d 100644 --- a/lib/generators/suspenders/views_generator.rb +++ b/lib/generators/suspenders/views_generator.rb @@ -3,7 +3,7 @@ module Generators class ViewsGenerator < Rails::Generators::Base include Suspenders::Generators::APIAppUnsupported - desc "Configures flash messages, page titles and the document lang." + desc "Configures flash messages, page titles and the document lang. Disables Turbo's InstantClick." source_root File.expand_path("../../templates/views", __FILE__) def install_gems @@ -20,6 +20,7 @@ def update_application_layout insert_into_file "app/views/layouts/application.html.erb", " <%= render \"flashes\" -%>\n", after: "
\n" gsub_file "app/views/layouts/application.html.erb", //, "\">" gsub_file "app/views/layouts/application.html.erb", /