Stanford running back Tyler Gaffney reaches out for a first down in the fourth quarter of Stanford’s 24-10 win over UCLA at Stanford on Saturday.

WAYNE THALLANDER/The Bulletin/

STANFORD (AP) — Any worries Stanford coach David Shaw had about how his team would respond from a loss at Utah last week subsided when more players showed up in the weight room the following day — a voluntary day off — than any time in the last two years.

The intensity picked up in practice throughout the week and showed up even more in a 24-10 victory over previously undefeated UCLA (5-1, 2-1) on Saturday that sent a resounding statement across the nation: the defending Pac-12 Conference champions aren’t going anywhere just yet.

After a week filled with upsets, the Cardinal (6-1, 4-1) climbed five spots to No. 8 in the new Associated Press poll Sunday. They are the highest ranked one-loss team.

“Guys were in there. Guys wanted to bounce back,” Shaw said. “They wanted to turn the page and move on, and the advice that I gave them earlier was, ‘Bring last week with you. Bring it with you. Bring the lessons learned about how hard you have to play, about how smart you have to play and about how you have to finish.’”

In the last four years, Stanford has been at its best after getting knocked down. The Cardinal haven’t dropped consecutive games since October 2009, when they lost at Oregon State and at Arizona.

Shaw said the resilience his team has shown goes well beyond scheme and talent. He credits the “tough-minded” character of players and coaches who embrace the challenge of correcting mistakes.

“That’s kind of our second nature,” said linebacker Trent Murphy, who has a team-leading seven sacks and 10 tackles for loss. “That’s how we practice and train in the offseason. The biggest thing is fighting adversity. It’s kind of one of our team goals, one of our team mottos, and that kind of starts in practice for us. We respond to everything. Definitely just our style of football.”

The road ahead will hold more obstacles to overcome.

Stanford plays Saturday at an Oregon State (6-1, 4-0) team that has won sixth straight since losing to FCS opponent Eastern Washington in a stunning upset that is looking more like an anomaly each week. The Cardinal host second-ranked Oregon (7-0, 4-0) on Nov. 7 before facing USC, California and Notre Dame.

Stanford, which already has been hit hard with injuries on its defensive line, might have to play at least part of that schedule without its No. 2 receiver.

Devon Cajuste caught seven passes for 109 yards against UCLA before leaving with a right knee injury early in the fourth quarter. He will have an X-ray and MRI on his knee this week, though Shaw said the injury isn’t “as bad as originally thought.” He said Cajuste was back on the sideline in the final minutes and told him the knee no longer hurt.

Shaw sounded more optimistic that kicker Jordan Williamson would return against the Beavers. Williamson, who is 9 for 12 on field goals this season, sat out with a leg injury against UCLA.

Redshirt freshman Conrad Ukropina, filling in for injured Williamson, missed a 46-yard field goal with 6:24 remaining that would’ve given Stanford a 10-point lead and likely put the game out of reach. He made a 31-yard field goal — his first career attempt — in the first quarter.

In the end, it made no difference. The Cardinal regrouped — just the way they always seem to in their recent renaissance under Shaw and his predecessor, Jim Harbaugh.

Stanford slowed down Brett Hundley to outgain UCLA 419 to 266 yards. The Cardinal won the time of possession 37:11 to 22:49 and made big the plays when it mattered most again.

“That’s what we do,” said Tyler Gaffney, who ran for a career-high 171 yards and two touchdowns. “That’s Stanford football.”