Forum: Ruby on Rails Routing questions

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.
F639e0cdf2fa098b535d6ec766b2aee1?d=identicon&s=25 Szymon Nowak (g0nzo)
on 2006-04-10 12:00
Hi!

I've just found out how to make my urls prettier by specifying custom
routing.
But i have few questions:

1. How to hide controller name from the url? I.e. my site is very
simple, so all actions that user can perform are in 'content'
controller. It's easy to redirect user to content/index when he enters
just site address, but when he clicks on any link, he gets url like:
'domain/content/action'. Is it possible to hide 'content' so he will
only see 'domain/action/'?

2. I've got a 'list' action that lists all products, or if it's given a
:type parameter lists products only of a given type. There are only 3
types of products, so i check in map.connect in requirements if the type
is correct. If it's not correct it sets type to default value nil, so
all products are listed. But the wrong type parameter is still visible
in the url. Can i somehow hide it if it's not correct?
This topic is locked and can not be replied to.