Forum: Ruby on Rails anyway to dry this up?

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.
Df5e7adb20adae6c120b04e7cafb15a0?d=identicon&s=25 Rob Sanheim (rsanheim)
on 2007-04-06 06:27
(Received via mailing list)
Is there a way to take this common route pattern:

  map.category '/by/:type/:category', :controller => 'category',
:action => 'show', :page_number => '1'
  map.connect '/by/:type/:category/page/:page_number', :controller =>
'category', :action => 'show', :page_number => /\d+/

And do it with one line?

btw, this allows /by/type/people (for page 1, implicit), and
/by/type/people/page/xx (for pages after 1).


- Rob
--
http://robsanheim.com
http://seekingalpha.com
This topic is locked and can not be replied to.