I'm trying to create a rule using ahoy's exclude method to exclude admin users from tracking as suggested here.
But I can't figure out how to get the User
object when I only have the controller
and request
. Any ideas?
I'm trying to create a rule using ahoy's exclude method to exclude admin users from tracking as suggested here.
But I can't figure out how to get the User
object when I only have the controller
and request
. Any ideas?
From the documentation, in your controller, (or ApplicationController), you can skip the action used to track a visit:
skip_before_action :track_ahoy_visit, if: :your_method_here?