 Being well @-@ educated themselves , the Ayyubid rulers became munificent patrons of learning and educational activity . Different madrasa @-@ type schools were built by them throughout the empire , not only for education , but also to popularize knowledge of Sunni Islam . According to Ibn Jubayr , under Saladin , Damascus had 20 schools , 100 baths , and a large number of Sufi dervish monasteries . He also built several schools in Aleppo , Jerusalem , Cairo , Alexandria , and in various cities in the Hejaz . Similarly , many schools were built by his successors also . Their wives and daughters , commanders , and nobles established and financed numerous educational institutions as well . 
