before_action in rails 5 code example Example: rails before_action before_action :run_method, only: [:index, :show]