What is collection and what is member?
resources :photos do
member do
get :preview
end
end
vs
resources :photos do
collection do
get :search
end
end
What is collection and what is member?
resources :photos do
member do
get :preview
end
end
resources :photos do
collection do
get :search
end
end
The first one let you request [GET]:
/photos/1/preview
# action 'preview' within PhotosController with params[:photo_id] == 1
The second one let you request [GET]:
/photos/search
# action 'search' within PhotosController