rails 5.2 before_action action variable available in all methods code example Example: rails before_action before_action :run_method, only: [:index, :show]