I see the word resource in many different places like: resource Routing, resourceful controller, and resources: photos. What does resource actually mean?
One more question: What does RESTful route mean?
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.
That’s a big question!
I’d start here to better understand what ‘resource’ or ‘resources’ does as it relates to routing: http://guides.rubyonrails.org/routing.html#resource-routing-the-rails-default
The short of it is that that it formalizes a set of actions (for a specific controller) invoked by URL/HTTP Verb pairs that are responsible for modifying the state of a given resource. Think of resources as nouns: Order, LineItem, Offer and think about what you might want to do with those nouns: typically create them, delete them, modify them, retrieve some set of them, etc. As such, resources are often (but certainly don’t have to be) your core model objects and/or some composite representation of those core models.
Again – the Rails Guides summarize what resourceful routes Rails very succinctly in Section 2.1 of the above link: ‘In Rails, a resourceful route provides a mapping between HTTP verbs and URLs and controller actions’
If you’re unfamiliar with REST, Wikipedia has some decent – but not exhaustive – coverage on the architecture: http://en.wikipedia.org/wiki/Representational_State_Transfer.