Is it a bad idea to reload routes dynamically in Rails?

后端 未结 4 656
萌比男神i
萌比男神i 2021-02-03 13:43

I have an application I\'m writing where I\'m allowing the administrators to add aliases for pages, categories, etc, and I would like to use a different controller/action depend

4条回答
  •  执念已碎
    2021-02-03 13:59

    Ben,

    I find the method you're already using to be the best. Using Rails 3, you'd have to change the code a bit, to:

    MyNewApplication::Application.reload_routes!
    

    That's all.

提交回复
热议问题