hotwired/turbo-rails

unexpected routes added as part of the turbo rails gem

kristoph opened this issue · 3 comments

I am using rails 7.1.2

Anytime I include the turbo rails gem I see these routes which I do not want to have added:

turbo_recede_historical_location GET /recede_historical_location(.:format) turbo/native/navigation#recede
turbo_resume_historical_location GET /resume_historical_location(.:format) turbo/native/navigation#resume
turbo_refresh_historical_location GET /refresh_historical_location(.:format) turbo/native/navigation#refresh

How can I remove these routes? Should these really be added as part of the turbo rails gem?

I see that I can ( presumably ) prevent these routes from being added by setting Turbo.draw_routes to false but I am at a loss to understand where that should be set.

I was able to solve this by simply creating a turbo.rb initializer and adding Rails.application.config.turbo.draw_routes = false.

But I will leave this issue open because it really seems bad form to have these routes be added by default. The purpose isn't even explained anywhere.

Hi @kristoph, those routes are used by Turbo Native. It's documented here