Forum: Ruby on Rails Possible to simplify these routes?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
81194a50c0f9bd95d7832a77fdf371bd?d=identicon&s=25 cool_screen_name90001 (Guest)
on 2005-11-12 12:49
(Received via mailing list)
In my routes.rb I have:

	map.connect
'items/category/:category_id/order/:order/page/:page',
		:controller=>'item',
		:action=>'list',
		:requirements => {:category_id => /\d+/}
	map.connect
'items/category/:category_id/order/:order',
		:controller=>'item',
		:action=>'list',
		:requirements => {:category_id => /\d+/}
	map.connect 'items/category/:category_id',
		:controller=>'item',
		:action=>'list',
		:requirements => {:category_id => /\d+/}
	map.connect 'items/order/:order/page/:page',
		:controller=>'item',
		:action=>'list'
	map.connect 'items/order/:order',
		:controller=>'item',
		:action=>'list'
	map.connect 'items/page/:page',
		:controller=>'item',
		:action=>'list'
	map.connect 'items',
		:controller=>'item',
		:action=>'list'

Yuck. Is it possible to simplify this? I tried adding
params like ':order=>nil', but that caused the wrong
URLs to get generated in pagination_links.

thanks
csn




__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
This topic is locked and can not be replied to.