-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turbo ignores form ending with action ending in parameter #1069
Comments
@DaAwesomeP thank you for opening this issue. My hunch is that the ignored URL is related to Lines 25 to 27 in 528dfdc
|
@seanpdoyle Thanks for the fast response! Yeah, that does sound like it could be it. I'm going to open a separate issue about issuing a warning if |
You can add a In Rails, you can use resources :users, trailing_slash: true You can see more at ActionDispatch::Routing::UrlFor documentation |
@DaAwesomeP Would you like to close this in favor of #608? |
@brunoprietog yes, sounds good! |
Hello!
I have found an issue where Turbo does not catch events for forms with an action ending in a parameter.
Example, this does not work:
This does work:
It's not clear to me if Turbo Rails is looking at
routes.rb
and deciding not to watch the form or if Turbo doesn't like the action URL.My
routes.rb
indeed does not expect a parameter here (so I had the wrong URL), but this was incredibly difficult to debug. Rails doesn't care if a parameter is stuck on the end even if it isn't defined inroutes.rb
and responds anyway. Some sort of tool (JS console?) or method or warning of why a form has been excluded from Turbo would be very nice here. This was especially confusing because the frame worked find but just not this particular form.At one point I had added
data: {turbo: true, turbo_stream: true}
and it was still ignored/not handled. There should really be a warning shown if a form is explicitly enabled but will still be ignored for some reason. I can open a separate issue for this once why it was ignored is determined.The text was updated successfully, but these errors were encountered: