From 47655c3975560c68cd2c6336592a14292126dc20 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 20 May 2024 14:12:00 -0300 Subject: [PATCH] feat: poder detectar cuando una peticion viene de htmx --- app/controllers/application_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f217c098..0fc2440f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -117,4 +117,9 @@ class ApplicationController < ActionController::Base session[:usuarie_return_to] = request.fullpath end + + # Detecta si una peticiĆ³n fue hecha por HTMX + def htmx? + request.headers.key? 'HX-Request' + end end