How to rename REST routes in URL?

前端 未结 2 1684
野趣味
野趣味 2020-12-25 12:32

Give that I have a model called Apple and it has a controller ApplesController, the routes are:

resources :apples

    apples  GET          


        
2条回答
  •  盖世英雄少女心
    2020-12-25 12:48

    For those seeking only to rename the helper method part:

    resources :apples, as: "cars"
    

    I.e. this would replace apples_path with cars_path, but still using the same controller/action.

提交回复
热议问题