views:

84

answers:

1

i wonder what the difference is here:

resources :photos do
  member do
    get :preview
  end
end


# vs


resources :photos do
  collection do
    get :search
  end
end

http://pastie.org/1001727

im not sure i dont understand it.

thanks

+2  A: 

A member route will require an ID, because it acts on a member. A collection route doesn't because it acts on a collection of objects. Preview is an example of a member route, because it acts on (and displays) a single object. Search is an example of a collection route, because it acts on (and displays) a collection of objects.

Theo