路由到非 RESTfull 控制器
routes to non-RESTfull controller
假设我有一个名为 HomeController
的控制器,我不打算将其用作 RESTful 资源,我如何以批量方式定义到该控制器的路由?例如:
controller :home do
collection do
get :dashboard
end
end
resources :home, only: [] do
collection do
get 'dashboard'
get 'another_dashboard'
end
end
假设我有一个名为 HomeController
的控制器,我不打算将其用作 RESTful 资源,我如何以批量方式定义到该控制器的路由?例如:
controller :home do
collection do
get :dashboard
end
end
resources :home, only: [] do
collection do
get 'dashboard'
get 'another_dashboard'
end
end