Team Org. Display

Hello everyone I am fairly new to Ruby on Rails. I am trying to right
an app. that lets you select your Team Leader and it will display their
boss, then their boss, then their boss all the way back to the top of
the company(like at this site ). I know how to get the
information into the database. I just don’t know how to tell it to
display it back on the page in the correct order. Any help in learning
Ruby on Rails way of doing this would be greatly appreciated.

Thank you,