-1

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
Arun
  • 1
  • 2

1 Answers1

0

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
Valery Kvon
  • 4,438
  • 1
  • 20
  • 15