In the Iowa Senate primary race, Joni Ernst is pulling ahead of her opponents in the GOP primary. Until Democrat Rep. Bruce Braley’s gaffe disparaging  farmers, the general election was not thought to be a competitive race. Now, polls show Braley leading Ernst by only single digits.

Iowa Republican Senatorial candidate Joni Ernst speaks during a campaign rally as former Alaska Gov. Sarah Palin, left, looks on, Sunday, April 27, 2014, in West Des Moines, Iowa. (AP Photo/Charlie Neibergall) Iowa Republican senatorial candidate Joni Ernst speaks during an April campaign rally as former Alaska governor Sarah Palin, left, looks on. (AP Photo/Charlie Neibergall)

Like Ben Sasse in Nebraska, Ernst’s appeal is broad. No novice to public service, she is a state senator and a lieutenant colonel in the Iowa National Guard. Mitt Romney endorsed her and is campaigning with her. The Des Moines Register editorial page and two conservative mainstays — the National Rifle Association and the U.S. Chamber of Commerce — all gave her the nod. Right-wing groups that spent their money on Milton Wolf and Matt Bevin by and large didn’t weigh in. Club for Growth and FreedomWorks as of this writing haven’t endorsed her. Senate Conservatives Fund has endorsed, but spent only about $25,000. Sarah Palin also endorsed her.

This is a case in which the actual grassroots — people in Iowa — and a good candidate with good timing have lifted a relative unknown into contention. A lot of the credit goes to Iowa Gov. Terry Branstad. He encouraged Ernst to run in April 2013, when Lt. Gov. Kim Reynolds decided against a run of her own. (For the sake of party unity, Branstad didn’t publicly endorse a candidate.) The lieutenant governor has long been a supporter of Ernst. When Reynolds got elected, it opened up her state Senate seat, which Ernst campaigned for and won in an early 2010 special election.  As a little-known state senator representing the most rural part of the state, with no statewide fundraising network, let alone nationwide donors, it is doubtful Ernst would have run without a boost from Branstad and Reynolds.

But most of the credit goes to Ernst herself. At the same time Braley made his much-publicized slur against Sen. Charles Grassley (R-Iowa) and Iowa farmers more generally, Ernst hit pay dirt with an ad that touted her farming roots, telling voters she grew up castrating hogs. The Post reported:

At a time when voters tune out many political messages, the ad was a vivid reminder of the enduring power of a single image. In the first three days, her 30-second spot was viewed nearly 400,000 times on YouTube and became the talk of cable news, catapulting the state senator from rural Red Oak into the top tier.

Ernst, a lieutenant colonel in the Iowa Army National Guard who says she proudly carries a pistol in her purse, followed up last week with her second ad, in which she steps off her Harley-Davidson and, wearing a black leather jacket, fires multiple shots with expert precision at a shooting-range target. The narrator says she’s aiming for President Obama’s health-care law.

She then became the perfect foil for Braley, leaving businessman Marc Jacobs in a less desirable position. If this was going to be Iowa farmer vs. Washington insider and snob race, Ernst was to be the candidate. She used that comparison to her advantage, labeling Jacobs a “very wealthy man.” ( “‘I still am a normal Iowan,’ she said. ‘He is a very wealthy man. I live in a home that I bought for $80,000. He lives in a home that most Iowans would never dream of owning.'”)

If she wins the primary on June 3, it will be because in-state Republicans saw something in her, Braley invited attack and she stepped up to the plate at just the right moment. She hasn’t raised a lot of money, but when the outside money isn’t sloshing through the race you don’t need millions. If she gets the nomination, Democrats will have to spend valuable time and money in a race that wasn’t on anyone’s radar screen a few months ago. At that point there will be lots of Republicans of all stripes who will step up to give her money. The lesson here as in Nebraska and elsewhere is that good candidates matter.