访问成员块上的根路径
Access root path on member block
我有以下路由块,想为 charges/:id
添加 GET
处理程序。
resources :charges, only: [:index, :create] do
member do
post :capture
end
end
我试过将 root :index
添加到 member
块,但没有成功..
你在这里尝试的是这里提到的表演动作:
guides.rubyonrails.org/routing.html#crud-verbs-and-actions
在 routes.rb 试试这个:
resources :charges, only: [:show, :index, :create] do
member do
post :capture
end
end
我有以下路由块,想为 charges/:id
添加 GET
处理程序。
resources :charges, only: [:index, :create] do
member do
post :capture
end
end
我试过将 root :index
添加到 member
块,但没有成功..
你在这里尝试的是这里提到的表演动作:
guides.rubyonrails.org/routing.html#crud-verbs-and-actions
在 routes.rb 试试这个:
resources :charges, only: [:show, :index, :create] do
member do
post :capture
end
end