我想在我的评论路线中添加一个 url,以便我可以调用“post_comments_latest_path”。我添加了类似 'get "comments/latest" => "comments#latest", :as => "latest"' 之类的内容,但路由添加了 :commend_id 到不需要的路径。有什么建议么?
resources :posts, :except => [:index] do
resources :comments, :except => [:index, :show] do
post "replies" => "comments#create_reply", :as => "create_reply"
get "replies/new" => "comments#new_reply", :as => "new_reply"
end
end