scope(path: 'u/:username', as: :user, constraints: { username: /[a-zA-Z.0-9_\-]+(? 'omniauth_callbacks#omniauth_error', as: :omniauth_error get '/users/almost_there' => 'confirmations#almost_there' end # Get all keys of user get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: /.*/ }