Converted Sinatra -> Rails