我有一个自定义路由,我需要在重定向调用中的“to:”键值对中添加id。我试过常规方法:
# My Cars
get '/api/cars/profile/:car_id', to: redirect('/cars/profile/:car_id')
我试过插值:
# My Cars
get '/api/cars/profile/:car_id', to: redirect("/cars/profile/#{car_id}")
但仍然没有解决方案
我有一个自定义路由,我需要在重定向调用中的“to:”键值对中添加id。我试过常规方法:
# My Cars
get '/api/cars/profile/:car_id', to: redirect('/cars/profile/:car_id')
我试过插值:
# My Cars
get '/api/cars/profile/:car_id', to: redirect("/cars/profile/#{car_id}")
但仍然没有解决方案
1条答案
按热度按时间dnph8jn41#
最后解决了它: