Oregon students learn how their food is raised and processed, and then comes the best part — eating it.

YAMHILL, Ore. — Don’t stand in the way of middle school students at lunch time, especially with the aroma of barbecued beef sandwiches filling the cafeteria.

Students at Yamhill-Carlton Intermediate School, many of them wearing western hats and boots for the occasion, were treated to a day-long lesson Wednesday on where their meat comes from, courtesy of the Oregon Cattlemen’s Association and the Oregon Farm to School program.

The sandwiches were a big draw, along with white and brown desserts called haystacks and cowpies, but Maupin, Ore., cattle rancher Keith Nantz and his dog, Pancho, may have been the star attractions. Nantz talked about raising cattle and fending off predators, and showed how his 5-year-old border collie responds to commands.

“The main thing is to teach them where food comes from and to close the gap between the urban and rural mindset,” Nantz said. There’s a “huge disconnect,” he said, and farmers and ranchers need to spend more time explaining agriculture in the context of Oregon’s economy, culture and food safety.

The event was an educational adjunct to the Farm to School program, which links growers and processors with school lunch programs. As schools have been called upon to provide more healthful meals, many are turning to local producers for fruit, vegetables, meat and grains. State funding encourages the switch.

Jane Gullett, the Yamhill-Carlton School District’s food service director, said students now get five entree choices daily and a self-serve fruit and vegetable bar. Lunchrooms offer whole grain bread products — even the nacho chips. About 60 percent of the district’s students eat school lunches.

“It’s going well,” Gullett said. “Students are pleased with what they get for lunch.”

So are local farmers and food processors. Yamhill-Carlton buys meat from Carlton Farms, a nearby processing plant that also sells to distributors and grocery chains. The barbecued top sirloin sandwiches served during Wednesday’s event came from Carlton Farms.

The processing plant sells 25 million pounds of meat annually, so the several hundred pounds of pot roast and ground beef the school district has bought this year doesn’t have much financial impact, but company President John Duyn is happy to take part.

In the past, before the federal government raised the nutrition standards for school lunches, the district bought pre-cooked, crumbled hamburger from another source, Duyn said. The meat was difficult to make palatable, he said, and students didn’t like it. Meat his company sells to the district comes from cattle raised in the Pacific Northwest and is processed less than 5 miles away, he said.

Duyn estimates half his 70 employees are Yamhill-Carlton graduates and many have children attending the district’s schools, and feel a connection to the district.

“It’s extremely important that they have quality protein that’s good and good for them,” Duyn said.

In nearby McMinnville, Betty Lou’s Inc. makes two kinds of fruit bars for the district and hopes to sell to more school districts in the future. The bars represent what school nutritionists are looking for: They contain no refined sugar and no hydrogenated oils, or trans fats. No wheat or GMOs, either, says John Sizemore, who supervises the company’s manufacturing plant.

“They’re healthy and the kids love them, and that’s a tough combination to beat,” Sizemore said.

The grant money comes from House Bill 2649, the Farm to School and School Garden Bill passed by the Oregon Legislature in 2013. Moving quickly, the state Department of Education in August awarded $1.17 million in grants to Yamhill-Carlton and 18 other school districts. Under the legislation, 82 percent of the money is to be spent buying Oregon food products and 18 percent can be spent on educational agricultural, food or garden activities.

Including ranchers from the Oregon Cattlemen’s Association in Wednesday’s assembly was part of the educational component emphasized in the Farm to School grant.

“We want students to have a great time and to learn about Oregon beef: Where it comes from, how it’s processed, and how it’s delivered to their tables,” said Gullett, Yamhill-Carlton’s food service manager.

In addition, school workers put up maps showing where Oregon products are grown, and the Cattlemen’s Association brought along some lassos and cow horn targets for the students to try their hands at roping.

Directly involving producers and groups such as the Cattlemen’s Association is a welcome expansion of the original idea of improving school nutrition, said Michelle Markesteyn Ratcliffe, program manager with the Oregon Department of Agriculture.

“Farm to School 10 years ago was about fresh fruit and vegetables,” she said. “Now it’s about the whole plate.”