executar o método antes dos trilhos
before_action :run_method, only: [index, :show]
Doubtful Dingo
before_action :run_method, only: [index, :show]