2017-03-26 84 views
1

假設我有一個名爲HomeController的控制器,我不打算將它用作RESTful資源,那麼如何以批量方式定義到此控制器的路由?例如類似這樣的:路由到非RESTfull控制器

controller :home do 
    collection do 
    get :dashboard 
    end 
end 

回答

0
resources :home, only: [] do 
    collection do 
    get 'dashboard' 
    get 'another_dashboard' 
    end 
end