Render URLs without numbers for singular resource routes
This fix allows the polymorphic_method in the HelperMethodBuilder class in polymorphic_routes.rb discern whether or not a singular resource is being passed into it. If it finds a singular resource it will pass in format: nil to the options so that we can have an edited object using the patch method get sent to the proper URL instead of appending a period and number to the end. I believe this is a better implementation than my first try. This works for nested and non nested routes utilizing resource
The current bug behavior in 7.1:
Started PATCH "/author.1" for ::1 at 2023-10-12 15:03:31 -0400
This fix corrects this to:
Started PATCH "/author" for ::1 at 2023-10-12 15:03:31 -0400
Fixes #49604
Checklist
Before submitting the PR make sure the following are checked:
- [x] This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
- [x] Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex:
[Fix #issue-number] - [x] Tests are added or updated if you fix a bug or add a feature.
- [x] CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.
I think this requires a CHANGELOG entry, as this is a behavioural change
I think this requires a CHANGELOG entry, as this is a behavioural change
Thanks for taking a look Petrik! I just implemented all of your suggestions.
Reopening, not sure why it closed.
Reopening, not sure why it closed.
You were pushed 0 commit.
You were pushed a 0 commit.
Yeah I was confused because I added the files to push locally. Something got lost in the process somewhere.