Resources versus resource rails 3

I was told that if I have only one โ€œthingโ€, for example, at home (and not several houses), I should use the resource: home, and not the resources: home at routes.rb. But then when I look at the routes, the POST function seems to want # create at home. Why is the plural? I wanted to call my home_controller controller a class that is a HomeController. Should I call them plural?

+6
source share
1 answer

Modified quote from http://guides.rubyonrails.org/routing.html#nested-resources :

Since you can use the same controller for a single route (/ home) and a multiple route (/ homes / 45), special resource maps for multiple controllers.

+8
source

Source: https://habr.com/ru/post/917491/


All Articles