[Nitro] Arbitrary length URIs

Jonathan Buch john at oxyliquit.de
Tue Jun 6 09:41:09 EDT 2006


> I tried this in my repository controller
> def index(*fpath)
> end

Which is almost the right way to do it :)

def show(*fpath)

should be used (like your url below) because mapping *fpath to index isn't
going to work if you have a url like:
/repository/dir_1/ etc (because it will look for a method called `dir_1` in
the controller.

> And am I going to have problems with periods?   Is something going to
> intercept what look like file requests before they get to my controller?
> As in..
> http://myssite.com/repository/show/dir_1/dir_2/dir_n/file.txt

If that file (file.txt) exists in the path
then it will be served, otherwise it will be handled by your controller.


Feel the love

More information about the Nitro-general mailing list