开发者

Strange Rails 2 Routing Question

开发者 https://www.devze.com 2023-01-08 08:34 出处:网络
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.

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.

post.resources :comments, :member =&开发者_如何学运维gt; { :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

comments/archived

0

精彩评论

暂无评论...
验证码 换一张
取 消