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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -