Ruby on Rails wildcard routing such as /foo.htm /foo.php /foo.something -


I am trying to create a routing situation where by default, any URL such as:

< P> / FO

/ some

/foo.php

/somethingelse.xml

/something.something.else

etc.

There will be all the routes for an administrator, assuming that they do not route anywhere.

I can work with the following codes in my routes:

map.myroute '/: file_or_folder' ,: Controller => 'My Controller'

It works fine as long as there are no dots in the URL:

/ something

but this is a work of:

/something.foo

Any thoughts?

Dots are not allowed by default, for which you can match file_or-folder You can specify a regex, such as:

  map.myroute '/: file_or_folder',: admin = & gt; 'Mycontroller' ,: file_or_folder = & gt; /.*/  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -