How to use around_action for all controllers except a specific one with some actions

Viewed 2058

In my application controller i use around_action to set the time zone in every controller action :

class ApplicationController < ActionController::Base
     around_action :user_time_zone

     def user_time_zone(&block)
        Time.use_zone("Central America", &block)
     end
end

but in a specific controller i won't to apply this time zone with some actions, so i want something like this :

around_action :user_time_zone, except: {controller: "foo" & action: "bar" & action: "other_action"}

there is a way to this ?

1 Answers
Related