proc in rails controller module code example
Example 1: rails before_action
before_action :run_method, only: [:index, :show]
Example 2: rails call a service
Service.call(args)
before_action :run_method, only: [:index, :show]
Service.call(args)