我想创建以下路线:
:controller/:user_id/foo, to: ':controller#foo'
示例:
"users/2/followers"
这就是我所拥有的:
get 'users/:id/followers', to: 'users#followers'
它有效...... 问题:
答案 0 :(得分:0)
我认为这是一个很好的解决方案:
resources :users do
member do
get :followers
end
end
路径是:
followers_user_path