Reputation: 399
I am trying to combine collection and member in the conversations path. But I could not figure it out,
resources :conversations, only: [:index, :show, :destroy] do
member do
post :reply
post :restore
end
end
and;
resources :conversations, only: [:index, :show, :destroy] do
collection do
delete :empty_trash
end
end
When I combine them it does not work, and obviously this one is wrong too!.
Upvotes: 0
Views: 209
Reputation: 3072
Combine member
and collection
in resources
block. Like this,
resources :conversations, only: [:index, :show, :destroy] do
member do
post :reply
post :restore
end
collection do
delete :empty_trash
end
end
Or you may combine it like this also,
resources :conversations, only: [:index, :show, :destroy] do
post :reply, on: :member
post :restore, on: :member
delete :empty_trash, on: :collection
end
Upvotes: 1
Reputation: 11876
try this
resources :conversations, only: [:index, :show, :destroy] do
member {
post :reply
post :restore
}
collection {
delete :empty_trash
}
end
Upvotes: 0