It is nearly impossible to prevent rats from getting into a coop short of spending a lot of money on hardware cloth and building a Fort Knox chicken pen. What you can do is drive them away by cutting off their source of food. Gotta stop the feed from being wasted and scattered and stop the mice and rats from being able to push feeder door open.
The only sure way is to use a treadle feeder with a spring loaded door, a counterweight,and a distant and narrow treadle. Any other design works for a while but eventually the rats will earn to overwhelm the treadle. There are some pretty feeders on the market but only one that actually works, it is not uncommon to see a 30% negative review rating on some of the commercial treadle feeders on Amazon. Someone has already posted a link to that customer review on my feeder so I won't post any links.
So it isn't black magic, restrict their access to feed and the rats will leave quickly. Poison isn't needed but it does suddenly work a day or so after you have a good treadle feeder because the rats are now starving and will eat the bait. Yes, the rats can eat dog poo and even chicken poo but they aren't going to stick around eating poo unless there is no where else for them to go.
If you do go with a treadle feeder remember these basics: Have the treadle bottoming out on the ground or a patio block. Fasten the feeder firmly to a very solid object like a post or wall to keep down vibration (shakes too much feed down) and turning the feeder over when it is close to empty. If the door is spring loaded be sure and adjust the spring to prevent the door from slamming too loudly and causing premature spring breakage. Follow the training instructions to the very letter if you want fast training, don't use logic on a chicken, don't block the door open unless it is a guillotine style feeder where you have no choice but to do that, do read all the reviews on the feeder because lots of people will post tips and tricks and exhort you to follow the directions (LOL, the only emails we get asking for help always turn out to be people that don't follow the directions). Full size birds of course or use a treadle extension and tweak the feeder.