Difference between resourceful and non resourceful routes? Actually I know one difference that we can create our custom paths in non resourceful routes. But this routes can also be possible by member and collection in resourceful routes. So what else is difference between them?
Asked
Active
Viewed 1,920 times
-1
-
1define "resourceful" and "non-resourceful" as you understand them. – Sergio Tulentsev Dec 29 '15 at 11:38
-
In resourceful routing, by default seven routes are generated,but in non-resourceful routing we have to generate specific routes with specific controller and it's corresponding action. – Nimish Dec 30 '15 at 05:37
1 Answers
1
Official Rails guide has great explanation for this topic.
Basically, resource
or resources
automatically create common routes for typical CRUD actions in your controller.

Vlad
- 401
- 3
- 7
-
1that I know that both automatically create common routes, then what is difference between them? I am also leaning from rails guide. – Nimish Dec 29 '15 at 13:54
-
2Difference between what? There is no such thing as "resourceful" or "non-resourceful" **route** in Rails. – Vlad Dec 29 '15 at 14:20
-
Every single route provides mapping between HTTP verbs and URLs to controller actions. `resources` just generates defaults. – Vlad Dec 29 '15 at 14:26
-
2Once again, you are able to do **resourceful routing**. Route is just a route. – Vlad Dec 29 '15 at 14:38
-
1In resourceful routing, by default 7 routes are generated,but in non-resourceful routing we have to generate specific routes with specific controller and it's corresponding action. – Nimish Dec 30 '15 at 05:37
-
@NimishJain: technically, there is no difference whatsoever. What can happen is, if you define a "custom" action (not one of those 7), then some rest purists will scold you. But rails won't care, not one bit. – Sergio Tulentsev Dec 30 '15 at 07:26
-
There is a difference that after creating non-resourceful route it will not create path as in resourceful route,path is automatically created. – Nimish Jan 02 '16 at 13:10