[英]Strange Rails 2 Routing Question
I saw this in a rails 2 vs 3 comparison pdf lecture and I'm not sure what's going on with the preview and archived flags. 我在Rails 2 vs 3比较pdf讲座中看到了这一点,但不确定预览和已存档标志的状态。
post.resources :comments, :member => { :preview => :post },
:collection => { :archived => :get }
Any ideas? 有任何想法吗?
:member => { :preview => :post}
Is establishing another method on the member that would would be accessed like so: 正在对成员建立另一个方法,如下所示:
comments/1/preview
and would only be accessible through post. 并且只能通过邮寄访问。
Similarly, :collection => {:archived => :get}
establishes a method for the whole collection, that would be accessed through 同样,
:collection => {:archived => :get}
为整个集合建立一个方法,可以通过以下方法访问
comments/archived
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.