from agaile-web-development-with-rails 4