Ruby on rails 3 rails 3新路线:新动作单数形式

Ruby on rails 3 rails 3新路线:新动作单数形式,ruby-on-rails-3,routes,Ruby On Rails 3,Routes,我不知道我是否对这件事吹毛求疵,但你如何创建一个:新的行动成员 当我有 resources :posts, :except => [:show] do get :another_new, :on => :collection end 这给了我一个复数(在routesother\u new\u posts GET/posts/other\u new(:format))中) 但当我使用member时,我得到的是单数,但它需要一个:id(在routesother\u new\u po

我不知道我是否对这件事吹毛求疵,但你如何创建一个:新的行动成员

当我有

resources :posts, :except => [:show] do
  get :another_new, :on => :collection
end
这给了我一个复数(在routes
other\u new\u posts GET/posts/other\u new(:format)
)中)

但当我使用member时,我得到的是单数,但它需要一个:id(在routes
other\u new\u post get/posts/:id/other\u new(:format)


如何使用
/posts/new
创建另一个新的,在routes中表示为
另一个\u new\u post

将其作为独立的部分放置在资源块之外:

match 'posts/another_new' => "posts#new", as: :another_new_post

添加:as只会更改名称(:另一个新名称)。在这种情况下,它给了我
另一个\u new\u post\u posts GET/posts/other\u new(:format)
第二个解决方案不会有这个问题。True。但我想知道是否有一种方法可以在这种格式下而不是使用match。我会等待更多的答案,但如果没有答案,这是唯一的方法,我会将此标记为我正在寻找的答案。控制器:post确实会得到“另一个新的”=>操作:新的,as::另一个新的\U post END除了资源之外,任何路由方法都会对您很好。。。