If you have three rails, then two nails in each slat at each rail intersection and nail the nails in at an angle toward the center. This will pin the sides down to tharwt cupping and hold in place. If you want, you can drive one in dead center also at each intersection with the rail.
Be sure, if using a power nailer that you do not have the power set to indent the nail head too deep. Have it about a hair below surface.
Remember, galv, zinc plated, electro plated, or stainless.