I have a custom action that does stuff, and at the end, i do the following
flash[:error] = "Error because x"
redirect_to back_or_index
With javascript disabled, everything works perfectly,my error is displayed, but the request header answered by the server is actually 404, because the index action returns 404 if flash[:error] contains anything (why ? the template is still displayed as if nothing happened).
With javascript enabled, Pjax runs, but because of the 404, Pjax assumes it failed, and asks for a new GET on idex without pjax, and without any content in flash.
Why is the index action returning a 404 ? The only thing that it does with pjax enabled is eating away the flash array
I have a custom action that does stuff, and at the end, i do the following
With javascript disabled, everything works perfectly,my error is displayed, but the request header answered by the server is actually 404, because the index action returns 404 if flash[:error] contains anything (why ? the template is still displayed as if nothing happened).
With javascript enabled, Pjax runs, but because of the 404, Pjax assumes it failed, and asks for a new GET on idex without pjax, and without any content in flash.
Why is the index action returning a 404 ? The only thing that it does with pjax enabled is eating away the flash array