Same routes in multiple resources

Viewed 105

I am working on a new rails application and came to this scenario. I want same routes in multiple resources but I don't want to repeat the same lines.

Is there any way to DRY up this

resources :contacts do
  collection do
    post :associate
    delete :remove
  end
end
resources :doctors do
  collection do
    post :associate
    delete :remove
  end
end

Any help will be appreciated.

1 Answers
Related