convert sinatra app to rails