-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unsafe Actions: Replace link_to
calls with button_to
#2516
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
from
February 13, 2024 23:58
8e8899a
to
6c6c04b
Compare
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
from
February 14, 2024 00:04
6c6c04b
to
71311da
Compare
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
from
February 14, 2024 00:27
71311da
to
d705c9f
Compare
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
from
February 14, 2024 00:29
d705c9f
to
4edb7e6
Compare
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
from
February 14, 2024 00:38
4edb7e6
to
c0742f0
Compare
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
2 times, most recently
from
February 14, 2024 01:12
665b11f
to
df4c1df
Compare
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
from
February 14, 2024 14:17
df4c1df
to
da2ed35
Compare
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
from
February 14, 2024 14:36
da2ed35
to
09a9d37
Compare
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
2 times, most recently
from
February 14, 2024 20:01
e926279
to
1d7af14
Compare
The `<a>` element is suitable for [Safe HTTP Methods][] (like `GET`) to drive page navigations. Unsafe HTTP Methods (like `POST`, `PUT`, and `DELETE`) are better initiated by `<form>` submissions. This commit replaces generated calls to `link_to` with calls to `button_to`. The rest of the styling changes aim to preserve design decisions made about preserving the appearance of elements that were once presented as `<a>` elements that are now presented as `<input type="submit">` elements nested within `<form>` elements. While the design changes preserved backwards compatibility, it's worth re-considering the choice to present them as "navigation" links instead of "action" buttons. [Safe HTTP Methods]: https://developer.mozilla.org/en-US/docs/Glossary/Safe/HTTP
seanpdoyle
force-pushed
the
replace-unsafe-link-to-with-button-to
branch
from
February 14, 2024 20:52
1d7af14
to
f700c43
Compare
Ah, excellent, thanks! |
f-moya
added a commit
to ApprenticeshipStandardsDotOrg/ApprenticeshipStandardsDotOrg
that referenced
this pull request
Nov 15, 2024
- Updated the administrate gem from version 1.0.0beta1 to 1.0.0beta2 in both Gemfile and Gemfile.lock. - Refactored the synonym show page test to check for a "Destroy" button instead of a link, in line with changes noted in the changelog https://github.com/thoughtbot/administrate/blob/main/CHANGELOG.md#100beta2-october-25-2024, specifically the update found in thoughtbot/administrate#2516.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
<a>
element is suitable for Safe HTTP Methods (likeGET
) to drive page navigations. Unsafe HTTP Methods (likePOST
,PUT
, andDELETE
) are better initiated by<form>
submissions.This commit replaces generated calls to
link_to
with calls tobutton_to
.The rest of the styling changes aim to preserve design decisions made about preserving the appearance of elements that were once presented as
<a>
elements that are now presented as<input type="submit">
elements nested within<form>
elements.While the design changes preserved backwards compatibility, it's worth re-considering the choice to present them as "navigation" links instead of "action" buttons.