-
Notifications
You must be signed in to change notification settings - Fork 156
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
Make error status for HTML/JS responses fully configurable #240
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
67ca16a
to
da1dcd8
Compare
This essentially makes the previous change merged via #223 configurable, so that we can keep the current behavior on existing apps, returning `200 OK` even for errors, while changing the generator for new apps to be configured with `422 Unprocessable Entity`, making them work better with Hotwire/Turbo installations out of the box. Please note that these defaults are likely to be swapped in a future major version of Responders.
We want to change these defaults for all apps eventually, so making sure new apps are generated with them by default will make this an easier transation to some in the future.
da1dcd8
to
9efc80b
Compare
Closed
If an app happens to have multiple responders on different controllers (which is entirely possible), they may not want to share the same set of statuses for responses. `cattr_accessor` would make that a global value across all of the apps responders, while `class_attribute` can be changed on each class individually if necessary (while still respecting the inherited values if any is set), making it much more flexible. Also disable instance writer and predicate methods, we only need access to read those values from the instance.
Just make it clearer how Hotwire/Turbo expects this to work, and how you can make responders work better with it. Please note that a future major version of responders might change the defaults to work that way out of the box, without explicit configs. [ci skip]
tagliala
pushed a commit
to tagliala/inherited_resources
that referenced
this pull request
Jun 6, 2024
Update responder class to the current defaults for responder gem Close: activeadmin#862 Ref: heartcombo/responders#240
tagliala
pushed a commit
to tagliala/inherited_resources
that referenced
this pull request
Jun 12, 2024
Update responder class to the current defaults for responder gem Close: activeadmin#862 Ref: heartcombo/responders#240
tagliala
pushed a commit
to tagliala/inherited_resources
that referenced
this pull request
Jun 14, 2024
Update responder class to the current defaults for responder gem Close: activeadmin#862 Ref: heartcombo/responders#240
javierjulio
pushed a commit
to tagliala/inherited_resources
that referenced
this pull request
Jun 15, 2024
Update responder class to the current defaults for responder gem Close: activeadmin#862 Ref: heartcombo/responders#240
tagliala
pushed a commit
to tagliala/inherited_resources
that referenced
this pull request
Jun 15, 2024
Update responder class to the current defaults for responder gem. `HttpCacheResponder` was deliberately excluded in version 1.8.0 Close: activeadmin#862 Ref: - heartcombo/responders#240 - a9fb8e1
tagliala
pushed a commit
to tagliala/inherited_resources
that referenced
this pull request
Jun 15, 2024
Update responder class to the current defaults for responder gem. `HttpCacheResponder` was deliberately excluded in version 1.8.0 Close: activeadmin#862 Ref: - heartcombo/responders#240 - a9fb8e1
javierjulio
pushed a commit
to tagliala/inherited_resources
that referenced
this pull request
Jul 2, 2024
Update responder class to the current defaults for responder gem. `HttpCacheResponder` was deliberately excluded in version 1.8.0 Close: activeadmin#862 Ref: - heartcombo/responders#240 - a9fb8e1
tagliala
pushed a commit
to tagliala/inherited_resources
that referenced
this pull request
Jul 27, 2024
Update responder class to the current defaults for responder gem. `HttpCacheResponder` was deliberately excluded in version 1.8.0 Close: activeadmin#862 Ref: - heartcombo/responders#240 - a9fb8e1
tagliala
added a commit
to tagliala/inherited_resources
that referenced
this pull request
Jul 27, 2024
Update responder class to the current defaults for responder gem. `HttpCacheResponder` was deliberately excluded in version 1.8.0 Close: activeadmin#862 Ref: - heartcombo/responders#240 - a9fb8e1
tagliala
added a commit
to tagliala/inherited_resources
that referenced
this pull request
Jul 28, 2024
Update responder class to the current defaults for responder gem. `HttpCacheResponder` was deliberately excluded in version 1.8.0 Close: activeadmin#862 Ref: - heartcombo/responders#240 - a9fb8e1
tagliala
added a commit
to tagliala/inherited_resources
that referenced
this pull request
Aug 20, 2024
Update responder class to the current defaults for responder gem. `HttpCacheResponder` was deliberately excluded in version 1.8.0 Close: activeadmin#862 Ref: - heartcombo/responders#240 - a9fb8e1
tagliala
added a commit
to activeadmin/inherited_resources
that referenced
this pull request
Aug 21, 2024
Change default error and redirect status codes Update responder class to the current defaults for responder gem. `HttpCacheResponder` was deliberately excluded in version 1.8.0 Close: #862 Ref: - heartcombo/responders#240 - a9fb8e1
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.
This essentially makes the previous change merged via #223 configurable,
so that we can keep the current behavior on existing apps, returning
200 OK
even for errors, while changing the generator for new apps to be configured with422 Unprocessable Entity
, making them work better with Hotwire/Turbo installations out of the box.Please note that these defaults are likely to be swapped in a future major version of Responders.