ruby on rails - Why does this route globpattern in routes.rb not match the url? -


i have pattern in routes.rb file:

match '/*', to: 'codeopenhub#index', constraints: { subdomain: 'code' }, via: :get 

when hit url code.lvh.me:3000, takes me incorrect landing page. similarly, when try request nonexistent url http://code.lvh.me:3000/abc, 404. makes sense page doesn't exist wouldn't have been routed codeopenhub#index page? before had get '/', to: 'codeopenhub#index', constraints: { subdomain: 'code' } correctly takes me landing page want. when try code.openhub.net/foo takes me wrong page.

how can route request code.openhub.net/abc or code.openhub.net/foo codeopenhubcontroller#index method?

----update------

i've tried add more parameters constraints hash such as:

get '/:id', to: 'codeopenhub#index', constraints: { subdomain: 'code', id: /[a-za-z]/ } 

but still did not work.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -