4 ms·
Thanks for the feedback. The belief is that though this practice may feel uncomfortable at first it should make things easier to mange in large applications. Th
by KrisJordan 18y ago
Thanks for the feedback. The belief is that though this practice may feel uncomfortable at first it should make things easier to mange in large applications. The premise is routes don't exist without a controller and method to route to - so why duplicate that information in another place? With routes stored somewhere else if you want to change a method name in a big app (especially one you're not the sole author of) there is an extra step of finding all the places that method name was potentially referenced. Routes in controllers is an attempt at being more DRY than routes.rb and less raw than Django's list of regexps.
For what its worth Rails actually generates code with comments that give examples of routes in its controllers: http://tinyurl.com/5jstgu http://tinyurl.com/5jstgu
Regarding not having to register, here are links directly to the bits: http://news.ycombinator.com/item?id=410119 http://news.ycombinator.com/item?id=410119