from my rail dev tutorial