Is there a way to setup config.middleware.use
to exclude / ignore / skip a specific controller action?
For example, if I wanted to exclude the Post#show
controller action.
I'm using https://github.com/railslove/rack-tracker to test Google Analytics/Tag Manager.
# Rack Tracker config
config.middleware.use(Rack::Tracker) do
handler :google_tag_manager, { container: ENV['GTM_CONTAINER_ID'] }
end
I thought I could use a condition like:
# Rack Tracker config
config.middleware.use(Rack::Tracker) do
handler :google_tag_manager, { container: ENV['GTM_CONTAINER_ID'] } if app.route != ApplicationController::PostController.show
end
Any help is much appreciated.