开发者

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.

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜