用于API的Rails路由

时间:2015-07-11 12:10:54

标签: ruby-on-rails ruby-on-rails-4

我正在尝试创建以下路线

/plans
/plans/:plan_id/notes
/plans/:plan_id/notes/:id

/notes/:note_id/reply
/notes/:note_id/upvote

这是我的路线档案

resources :plans, only: [:create, :index, :show] do
  resource :note, only: [:create]
  resources :notes, only: [:destroy]
end

resources :notes, only: [:index] do
  resource :note_replies, only: [:create, :destroy]
  resources :note_upvotes, only: [:create, :destroy]
end

有没有办法删除为笔记创建的路线重复?

0 个答案:

没有答案