I’m trying to my a url that has optional (and not optional values)
for example
http://myserver/store/cats/a/b/c
A and C are optional
where the following are valid
http://myserver/store/cats/a/b/c
http://myserver/store/cats//b/c
http://myserver/store/cats/a/b
http://myserver/store/cats//b
And the following is invalid
http://myserver/store/cats/a//c
I know the last value can be optional by including ,:c=>nil
But the only way I can think of for middle values to be optional is to
have all permutations written out.
for example
map.connect ':store/:cats/:a/:b/:c, :c=> nil
map.connect ':store/:cats//:b/:c, :a=> nil, :c=> nil
For a couple of variables this is fine, but moving to 3 or more, and it
gets nuts fast.
Is there an easier way to handle this?