I want to have a sub domain for this particular route
get 'product_list/home'
Previously the url used to be like localhost:3000/product_list/home
. Now I want the url to be store.dev:3000/product_list/home
I have modified the route like this
constraints subdomain: 'store' do
get 'product_list/home'
end
In the /etc/hosts. I have added a store.dev as follows
127.0.0.1 localhost
127.0.0.1 store.dev
But when visited store.dev:3000
in dev environment, I am getting my homepage just like localhost:3000
.
But I want to restrict my subdomain to only this route product_list/home
.
And one more problem I am facing is
http://store.dev:3000/product_list/home when I visit this
I am getting this
No route matches [GET] "/product_list/home"
UPDATE:
After changing the entry in the hosts file .. from store.dev
to store.local.dev
it works I am able to access store.local.dev:3000/product_list/home.
But my problem is I am able to access other pages also, say I have about
page. store.local.dev:3000/about
, but I don't want this to happen. How to restrict the subdomain to only one particular route