Rails Routing Beta
Published 15 February 05 by Justin French, 2 comments
Sure, it’s only in Beta right now, but from what I can tell, it looks like one highly refined, polished, slick, endlessly customizable solution to clean URLs.
The current default rewrite rules for Rails total six lines (three for the /controller/action/id version, and three for the module/controller/action/id version). Add in a couple of custom URL schemes (all of which require about three long rewrite lines each), and it’s a huge mess.
Looking at the small examples given, it would appear that for every two or three mod_rewrite lines in a .htaccess file, Routing can solve it in just one easy-to-read line.
And we’re not stuck with the standard module, controller, view and id here – we can assign pretty much anything we like. I’m sitting here with a huge grin on my face as I think about the seemingly endless possibilities.
Better still, since all the new rules are in the application code (not in the public HTML folder), this will make it much easier for programmers to distribute updates to Rails applications.
I’ll have to wait for further documentation and examples, but this is really exciting stuff.
Update: The documentation has also been made available as a “work in progress” – to repeat myself, this looks fantastic.
Before you go…
Here’s some links to my most popular posts: