如何将一些复杂的路线从 Rails 2.3 转换为 Rails 3.1?
我正在开发一个项目,将 Rails 2.3 应用程序升级到 Rails 3.1。有件事我无法弄清楚。下面是 Rails 2.3 应用程序中定义的路由:
map.resources :segments, :collection => { :listen => :get, :comment => :post, :inside => :post, :around => :post , :suggest => :get, :ipeds => :get, :search_ipeds => :get }, :member => { :listen => :get }, :has_many => [ :photos , :school_statistics, :comments, :ad_spots ] do |segments|
segments.resources :visits , :only => [ :index ], :collection => { :destroy_all => :delete }
end
我不确定如何使用 Rails 3.1 编写此路由来执行此路由使用 Rails 2.3 执行的相同功能。我在网上搜索了一些资源来解释这一点,并且我还阅读了 Ruby on Rails 网站上的路线文档,但我仍然无法获取它。
I am working on a project where I am upgrading a Rails 2.3 application to Rails 3.1. There is one thing which I am not able to figure out. Below is a route defined in a Rails 2.3 application:
map.resources :segments, :collection => { :listen => :get, :comment => :post, :inside => :post, :around => :post , :suggest => :get, :ipeds => :get, :search_ipeds => :get }, :member => { :listen => :get }, :has_many => [ :photos , :school_statistics, :comments, :ad_spots ] do |segments|
segments.resources :visits , :only => [ :index ], :collection => { :destroy_all => :delete }
end
I am not sure how to write this route using Rails 3.1 to perform the same functionality which this route is performing using Rails 2.3. I searched online to find some resources which explains this and also I read the routes documentation on the Ruby on Rails website but I still can't get it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里免费编码,但我想这会为你做的
free coding here but I guess this would do it for you