The 28-year-old actor, who plays a rowdy jatt in this Imtiaz Ali directed film, lived with a Jatt family to experience their lifestyle as part of his character study.
"Ranbir had the time of his life trying to milk the cows. It was such an amusing sight.
Everyone was in splits. But all in all, they learnt a lot about the lifestyle of a typical jatt family which was important for filming; and also ended up having a great time doing things that they wouldn't otherwise get to experience," a source said.
In the film, Ranbir plays 'Janardan Jakhar', the youngest son of a traditional Jatt family and therefore it was important for him to pick up their mannerisms to put up a convincing act.
"Imtiaz and Ranbir spent an entire day with a Jatt family based in the outskirts of Delhi. They would hang around with the young boys of the family, sleep on the cots, eat out at the local dhabas and enjoy hookah in the evening," the source added.
'Rockstar' will mark the debut of international model Nargis Fakhri opposite Ranbir. The film will hit the theatres on November 11.