вот мой config/routes.rb
:
Eesoudayo::Application.routes.draw do
resources :articles do
resources :comments
end
end
... который, как вы можете себе представить, генерирует следующие маршруты:
article_comments GET /articles/:article_id/comments(.:format) {:action=>"index", :controller=>"comments"}
POST /articles/:article_id/comments(.:format) {:action=>"create", :controller=>"comments"}
new_article_comment GET /articles/:article_id/comments/new(.:format) {:action=>"new", :controller=>"comments"}
edit_article_comment GET /articles/:article_id/comments/:id/edit(.:format) {:action=>"edit", :controller=>"comments"}
article_comment GET /articles/:article_id/comments/:id(.:format) {:action=>"show", :controller=>"comments"}
PUT /articles/:article_id/comments/:id(.:format) {:action=>"update", :controller=>"comments"}
DELETE /articles/:article_id/comments/:id(.:format) {:action=>"destroy", :controller=>"comments"}
articles GET /articles(.:format) {:action=>"index", :controller=>"articles"}
POST /articles(.:format) {:action=>"create", :controller=>"articles"}
new_article GET /articles/new(.:format) {:action=>"new", :controller=>"articles"}
edit_article GET /articles/:id/edit(.:format) {:action=>"edit", :controller=>"articles"}
article GET /articles/:id(.:format) {:action=>"show", :controller=>"articles"}
PUT /articles/:id(.:format) {:action=>"update", :controller=>"articles"}
DELETE /articles/:id(.:format) {:action=>"destroy", :controller=>"articles"}
Мой вопрос: Есть ли сексуальный способ немного их почистить, давая такой результат?
article_comments GET /:article_id/(.:format) {:action=>"index", :controller=>"comments"}
POST /:article_id/(.:format) {:action=>"create", :controller=>"comments"}
new_article_comment GET /:article_id/new(.:format) {:action=>"new", :controller=>"comments"}
edit_article_comment GET /:article_id/:id/edit(.:format) {:action=>"edit", :controller=>"comments"}
article_comment GET /:article_id/:id(.:format) {:action=>"show", :controller=>"comments"}
PUT /:article_id/:id(.:format) {:action=>"update", :controller=>"comments"}
DELETE /:article_id/:id(.:format) {:action=>"destroy", :controller=>"comments"}
articles GET /.:format) {:action=>"index", :controller=>"articles"}
POST /.:format) {:action=>"create", :controller=>"articles"}
new_article GET /new(.:format) {:action=>"new", :controller=>"articles"}
edit_article GET /:id/edit(.:format) {:action=>"edit", :controller=>"articles"}
article GET /:id(.:format) {:action=>"show", :controller=>"articles"}
PUT /:id(.:format) {:action=>"update", :controller=>"articles"}
DELETE /:id(.:format) {:action=>"destroy", :controller=>"articles"}
PS: я работаю с Rails 3.x <3 </p>