RoR routes explanation
Can you explain me what these lines of code do ?

    resources :posts, :pages do
          post 'preview', :on => :collection
        end
    
    resources :undo_items do
          post 'undo', :on => :member
    end
RoR routes explanation
===

Can you explain me what these lines of code do ?

    resources :posts, :pages do
          post 'preview', :on => :collection
        end
    
    resources :undo_items do
          post 'undo', :on => :member
    end