I need to setup vanity urls for some models in my application, basically it's a product catalogue and I have Store
, Brand
and Category
models. What I need here is setting up username like URLs for all these 3 models, so the routes should appear like
http://mysite.com/brandname => http://mysite.com/dell
http://mysite.com/categoryname => http://mysite.com/laptops
http://mysite.com/storename => http://mysite.com/delluk
All these 3 routes should render index action of products controller and show the products belongs for the given store, brand or category.
Please let me know if there is gem to get this done. I'm trying this gem https://github.com/jaustinhughey/vanities at the moment but yet I couldn't figure out how to use it as described above.