简体   繁体   English

在数据库中存储Rails 3路由

[英]Storing Rails 3 Routes in Database

By question is actually pretty simple. 问题其实很简单。 I'd just like to know if anybody was able to load their Rails 3 routes into a database so that they could be manipulated without server access from an admin panel like Typus. 我只想知道是否有人能够将他们的Rails 3路由加载到数据库中,以便可以在没有服务器访问的情况下操纵它们,例如Typus等管理面板。 If anyone has pulled this off or knows of an effective way to do it, please let me know as I am really curious to pull this off on Rails 3. 如果有人已经取消了这个或知道有效的方法,请告诉我,因为我真的很好奇在Rails 3上取消这个。

You may have to handle your own dispatching with a route like "*path" . 您可能必须使用"*path"类的"*path"处理自己的调度。 Then /foo/bar/123 would route to a controller of your choice where params[:path] is an array ['foo', 'bar', '123'] . 然后/foo/bar/123会路由到你选择的控制器,其中params[:path]是一个数组['foo', 'bar', '123'] Then you could do whatever from there. 然后你可以从那里做任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM