if I have
resources :projects
root to: "projects#index"
in my routes file would it be more succinct to do
resource :projects
root to: "projects#index"
or any reason this won’t work because I don’t see anyone doing it
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, because they’re two different methods that do two different things.
resourcesis meant for when you have more than one of the model object (a plural resource), whereasresourceis meant for when it is a singular resource. For this reason, usingresourcedoes not create anindexroute and none of the routes take an ID parameter in the URL. To quote the docs:That said, I wouldn’t really consider saving one character “more succinct” anyway.