Rails, how does it work?