Once you've mastered how to do an ollie on your skateboard, you will be ready to learn to boardslide. Check out this video and learn how to do this very cool trick.
Approach your board at a moderate speed.
When you are about a foot and a half away from the rail, do an Ollie and turn your body 90 degrees. Now, your board should be perpendicular to what you are grinding on.
Land on the rail and stay forward. MAKE SURE you stay forward or your board will fly away and you will injure yourself on the rail.
As the end of the rail approaches, turn your body back 90 degrees like you did before. Slide off of the rail, finish the rotation in the air.
Stomp the landing and ride away normally.