nice urls?

Can anyone please explain to me how to get ugly urls like :

hostname.com/browse/day?cal_name=name&day=9&month=6&year=2008

to be something nice like:

hostname.com/browse/name/day/month/year

or something like that?

I've read a bit about routes but I don't see any examples anywhere really of how to do this.

map.connect 'browse/:cal_name/:day/:month/:year', :controller => 'browse', :action => 'day'

Assuming that the default route was picking up your example URL.

-Rob

Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com

map.connect 'browse/:cal_name/:day/:month/:year', :controller => 'browse', :action => 'day'

Assuming that the default route was picking up your example URL.

-Rob

Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com

where do I do that?

In your project's config/routes.rb file, of course.

oh lol thanks so much!

Amanda,

You may want to read into how you can setup customer routes using the routes.rb files in rails... Furthermore you may want to read into RESTful development, and how rails deals with Resources etc... might help with your issue here.

There's a TON of information on this on the net, and there's just too much to go through here...

Or, I find The Rails Way by Obie Fernandez exceptionally clear on this topic. Excellent book in many ways, but it seems to really shine on routings.

Ron