Replace button_link_to with either button_to or link_to #2601
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.
Similar to #2600 (and built on top of it to avoid conflicts)
This replaces all uses of our
button_link_to
helper with eitherbutton_to
orlink_to
.There's no reason for
button_link_to
to exist. Either we want a link (which we can style like a button easily if we want) or just a button. We should explicitly use the one we want given the situation.All occurrences of
button_link_to
can be replaced with eitherbutton_to
orlink_to
withclass: 'btn btn-primary'
. Both Rails built-in helpers can have a:method
specified, and both are able to perform a GET request.I've chosen to replace all
button_link_to
with a method withbutton_to
, since that was the behaviour of the method, and the most appropriate use of abutton
andform
tag.I've replaced all
button_link_to
which did not specify a method (a GET request is desired) withlink_to
, since that was the previous behaviour and because this is what a link is.(This should be rebased before merging)