Okay so right now I have this as a route:
map.connect ‘browse/:cal_name’, :controller => ‘browse’, :action =>
‘events_listing’
If the :cal_name has spaces in it (Test Calendar) for example, then the
url appears as Test+Calendar in the url. Is there a way to substitute
something else (say ‘-’ or something) for the ‘+’ in the url?
I’d mix things up a little bit. I’m going to assume some things about
your model names, but that’s not the important part 
class Calendar < ActiveRecord::Base
assuming the following columns: id:integer, name:string
def to_param
“#{id}-#{name.gsub(/[^a-z0-9]+/i, ‘-’).downcase}”
rescue
id
end
end
Then change your route to this:
map.browse_calendar ‘browse/:calendar’, :controller => ‘browse’, :action
=> ‘events_listing’
Then in your controller do this:
@calendar = Calendar.find(123) # assuming id=123 is ‘Test Calendar’
And in your view do this:
<%= link_to ‘Browse’, browse_calendar_path(:calendar => @calendar) %>
That should result in a URL such as:
/browse/123-test-calendar
If for some reason doing the substition in that to_param() method fails
you will get:
/browse/123
In either case you can then use that information in your events_listing
action to retrive the calendar using:
Calendar.find_by_id(params[:calendar])
You could also change the to_param() method to not put the “123-” at the
beginning, but would then need to tweak your finding later on to look
for either an id or a calendar name.
Hope this helps,
-philip