Hello, I have some models like News and Downloads which have_many comments :as => :commentable. Comment belongs_to :commentable and is :polymorphic. Like the comments, there are subscriptions. So my routes look like this:
resources :news do
resources :comments do
post :like, :on => :member
delete :like, :on => :member
end
resources :subscriptions
...
end
resources :downloads do
resources :comments do
post :like, :on => :member
delete :like, :on => :member
end
resources :subscriptions
...
end
...
Is there a way to DRY this up? I tried defining
def comment_resources
resources :comments do
# ...
end
resources :subscriptions
end
at then top of routes.rb and then calling comment_resources but it seems dirty to me because it isn't namespaced / in a class correctly.