Valmiki Ramayana Ayodhya Kanda Sarga 17 Shloka 15
Original Shlokaसर्वेषु हि स धर्मात्मा वर्णानां कुरुते दयाम्।।2.17.15।। चतुर्णां हि वयः स्थानां तेन ते तमनुव्रताः।
1 source checked for this shloka
धर्मात्मा righteous one, सः he, चतुर्णाम् four, वर्णानाम् relating to castes, सर्वेषु in all people, वयःस्थानाम् to the young and old, दयाम् compassion, कुरुते does, तेन so, ते they, तम् him, अनुव्रताः were devoted.
That righteous Rama shows compassion to all, to the four castes, to the young and the old. So they were devoted to him.