Closed taq closed 1 year ago
Uh, sorry. Seems even with the en
file code was changed. But I still getting a Completed 302 Found
when using respond_with
after an update. Is there any way to force/check :see_other
?
@taq thanks for your report.
The redirect_status
config should apply even though it's inside that initializer named responders.flash_responder
, I believe that's just a naming that was used by the time since the only configs responders had were related to the flash responder, this is the first one that is for the responders themselves.
I was just testing redirect_status
with a new error_status
branch I'm working on https://github.com/heartcombo/responders/pull/240, and it appears to be working. I can change it via the config and restart Rails, which seems to pick up the change to the status I configure it to.
Which responders version are you using? The redirect_status
is only on main, not a released version, so make sure you're pointing to that. (I hope to release a new version soon, once I finish my changes and ensure they're working as expected)
Hey @carlosantoniodasilva , thanks for your answer.
Using responders (3.0.1)
@taq gotcha, so redirect_status
is really only available on main branch right now, I'm hoping to cut a new release soon. If you wouldn't mind giving that one a try, let me know if you run into any issues.
(You can also try out my branch if you want the 422 Unprocessable Entity
behavior, by configuring error_status
as well -- see the description there, it's going to main soon for the release I'm planning.)
Thanks 👍🏻🙂
I was having some issues with redirection on Firefox, getting a "Error: Form responses must redirect to another location" from turbo, and noticed that seems I needed a 302 redirect different status. As said on the README:
This would solve my problem, but I was not getting the custom redirect status working. I checked on console via
And got
:see_other
, ok, but it was still not working (on Chrome everything was fine). Then I saw that on the responders.rb fileActionController::Responder.redirect_status
is located inside theinitializer "responders.flash_responder"
block, setting thecattr_accessor :redirect_status
. As I didn't have a flash YAML file, the default one installed with the generator is foren
and I'm usingpt-BR
as my app language, I suppose theredirect_status
attribute was never set.When I created the
pt-BR
flash file, everything worked. So, I'm not sure if is just code on the wrong place, if the flash file is mandatory or I am missing something. Maybe running the app always withen
set with the file created by the generator can miss this point on other languages.Thanks!