The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

routes_doubt

hi. as an experiment i decide to: rake routes , considering my routes.rb file has only: map.resources users. well, we all know the output, but based on this output the last 3 mappings which are: show(get), update(put) and destroy(delete):

based on the output above i decided to write the equivalent routes in the routes.rb file in order to mimic what map.resources does. so we will have 7 routes. to simplify let’s just consider here these last 3 routes. first, based on the output above, my conclusion is that i could use 3 routes with the same name: map.user and differentiate then with the :method symbol, being get, put and delete for each one of them … so rails would know which one to use based on the :method

well, that doesn’t work … if i click delete in the view then the show action will be triggered. my 2nd conclusion is that since i’m not using map.resources and instead i’m using named_routes, then the routing system will use the top-first rule

my doubt is, how rails understand map.resources since the output from rake routes doesn’t imply us to do something like: