match /profile => redirect("/profiles/{current_user.name}")
env [‘warden’]似乎没有设置,所以我无法访问warden.user.name.
get '/profile',to: redirect { |params,request| me = request.env["warden"].user(:user) me ? ('/profiles/' + me.name) : '/' }