I reckon this works:
# change in config/routes.rb
get '/profile/:id(/:username)' => 'profiles#show', :as => :profile
# change in app/controllers/profile_controller.rb
@user= User.find(params[:id])
# add to app/models/user.rb
def to_param
"#{id}/#{username}"
end
Where username
is whatever friendly_id uses to generate the slug