How to understand ruby controller?