Assuming you're referring to a hayride as in a festive activity where people ride on a hay-filled wagon pulled by a tractor or other vehicle, the answer is that there is no specific dress code. You should, however, dress for the weather and for the activity. That means wearing comfortable, closed-toe shoes and clothes that you don't mind getting dirty or wet. A hayride can be a lot of fun, but it's also a bit of a bumpy ride, so you don't want to wear anything too fancy or delicate.