The great secret of education is to direct vanity to proper objects.19 Never suffer him to value himself upon trivial accomplishments. But do not always discourage his pretensions to those that are of real importance.
 Adam Smith, The Theory of Moral Sentiments (1759). copy citation

Context

“Though your son, under five-and-twenty years of age, should be but a coxcomb; do not, upon that account, despair of his becoming, before he is forty, a very wise and worthy man, and a real proficient in all those talents and virtues to which, at present, he may only be an ostentatious and empty pretender. The great secret of education is to direct vanity to proper objects.19 Never suffer him to value himself upon trivial accomplishments. But do not always discourage his pretensions to those that are of real importance. He would not pretend to them if he did not earnestly desire to possess them. Encourage this desire; afford him every means to facilitate the acquisition; and do not take too much offence, although he should sometimes assume the air of having attained it a little before the time.
source