rails call before other method code example Example: run method before rails before_action :run_method, only: [index, :show]