RESTful routes and resulting urls

with the old routing you used to be able to specify an abitrary route
for any controller like so:

map.connect “blah/:action/:id”, :controller => ‘foo’

how can i do this with the new RESTful resources??

-felix

On 11/17/06, felix [email protected] wrote:

with the old routing you used to be able to specify an abitrary route
for any controller like so:

map.connect “blah/:action/:id”, :controller => ‘foo’

how can i do this with the new RESTful resources??

-felix

You can mix old and new routes together.


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com

I know I can have them both but I have some nested routes and the url
is becoming a little long. what i wanted to do is ‘alias’ some of the
sections on the url so that the result is much shorter.

an example:

/product_categories/3/products

becomes

/cat/3/products

these are short examples but there are longer urls because of my model
naming.

thanks for you suggestions.

-felix

On 11/17/06, felix [email protected] wrote:

/cat/3/products

these are short examples but there are longer urls because of my model
naming.

thanks for you suggestions.

Try this?
map.resources :cats, :controller_name => 'product_categories do |cats|
map.resources :products
end


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com