Volver al referer o al sitio después de enviar formularios

This commit is contained in:
f 2021-07-29 10:55:21 -03:00
parent 6b67f13aaf
commit 5d9c379e0e
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ module Api
contact_params.to_h.symbolize_keys, contact_params.to_h.symbolize_keys,
params[:redirect] params[:redirect]
redirect_to params[:redirect] || origin.to_s redirect_to params[:redirect] || referer || site.url
end end
private private

View file

@ -17,7 +17,7 @@ module Api
site.touch if service.create_anonymous.persisted? site.touch if service.create_anonymous.persisted?
# Redirigir a la URL de agradecimiento # Redirigir a la URL de agradecimiento
redirect_to params[:redirect_to] || origin.to_s redirect_to params[:redirect_to] || referer || site.url
end end
private private