Dynamic URL -> Controller mapping for routes in Rails

后端 未结 4 915
死守一世寂寞
死守一世寂寞 2020-12-13 10:55

I would like to be able to map URLs to Controllers dynamically based on information in my database.

I\'m looking to do something functionally equivalent to this (ass

4条回答
  •  一整个雨季
    2020-12-13 11:30

    Here is a nice Rack Routing solution to SEO contributed by zetetic and Steve ross

    Testing Rack Routing Using rSpec

    It shows you how to write a custom dispatcher (where you can do a db lookup if needed) and with constraints, and testing as well.

提交回复
热议问题