He batted fourth, with first baseman Adrian Gonzalez moving to fifth for the first time this season in a new-look lineup that manager Don Mattingly said he has been planning since the Dodgers were in Philadelphia last weekend.
Mattingly wrote an earlier lineup without Ramirez, but said he was hoping he'd have to redo it.
"Early in the day, we thought we might have to go all the way through batting practice," Mattingly said. "We found out early Hanley felt good. I didn't have any reservations."
Gonzalez, who playfully pretended to complain about hitting fifth in the clubhouse and dugout, batted fourth in all 50 previous starts this season.
The Dodgers are now grouping their lefties together, with Dee Gordon and Carl Crawford 1-2 and Gonzalez and Andre Ethier 5-6, with right-handed-hitting Yasiel Puig and Ramirez between them at 3-4, to make it more difficult for opposing teams to match up with left-handed relievers, Mattingly said.