Yes and no. They don't necessarily need a rack, but they need plenty of clean hay. If you put it in their cage floor they could potty on it making it unsuitable to eat. You can put hay on the floor every so often to compensate for this, but that could last all day. A rack is also good because the pigs will get exercise reaching for the hay. I find the best is to have a rack for them so they can get exercise certain times when they eat, and then reward them a certain time or times of the day with hay on the floor of their cage for them to devour. I have a brick in the cage so I sit the hay on that to detour pottying on the hay. I usually put some down at nighttime before bed. It is so cute because they know it is hay on floor time and start running.