demarches-normaliennes/app/controllers/admin
Pierre de La Morinerie 51cb3a04a3 app: fix JS redirection with Turbolinks disabled
When Turbolinks is enabled, a `redirect_to` in a `format: :js` request
will emit code that instructs Turbolinks to navigate to the page.
Turbolinks will then load the redirection target as HTML, and display
it.

But with Turbolinks disabled, the same `redirect_to` will instead
respond with a standard `302: redirect`. `Rails.ajax` will interpret
this redirect as "Please perform the same call again to the redirected
URL, in the same format" – and request our redirection target, but
using `format: :js`.


This breaks the "Publish procedure" button. In that case, we really want
the page to be navigated to. Add an explicit JS redirect, so that the
redirection occurs in HTML.
2020-05-13 11:04:16 +02:00
..
assigns_controller.rb assigns: strip and lowercase the search filter 2019-11-06 12:16:30 +01:00
attestation_templates_controller.rb fix attestation template error case 2020-02-28 16:33:07 +01:00
instructeurs_controller.rb instructeurs: fix email casing in invitation 2019-11-05 10:54:58 +01:00
mail_templates_controller.rb When mail template is updated, stay on edit page to easily preview it 2019-04-11 11:03:13 +02:00
procedures_controller.rb app: fix JS redirection with Turbolinks disabled 2020-05-13 11:04:16 +02:00