ruby on rails - Why should I pluralize controller name for RESOURCE -


i understand there convention, controllers' names should pluralised.

but why should pluralize controller's name resource?

so ok:

resources :apples 

but not:

resource :apple, :controller => "apple" 

why not?

resource :apple  

resource different resources. it's used if have one.

as this guide explains, it's useful if ever reference one. if have, example, profile never mention id, assume current user needs access or edit own profile.

you can mix these, too. want users able view each other's profiles, have url own profile:

resources :profiles resource :profile 

Comments