A straight-edge can be used to draw out a straight line or to ensure that a surface is flat.
A ruler on the other hand can be used to draw a straight line, check for flatness, and measure length.
Rulers and straight-edges can be made from a variety of materials including: metal, wood, and plastic.