File size: 703 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Rails.application.routes.draw do

  resources :friend_requests
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
  namespace :api, defaults: { format: :json } do
    get "users/search", to: "users#search"
    get '/users/:id/wall', to: 'posts#wall_posts'
    get '/users/feed', to: 'posts#feed'
    resources :users, only: [:index, :create, :show, :update] do
      resources :friend_requests, only: [:index, :create,:update,:destroy]
    end

    resources :posts, except: [:new, :edit] do
      resources :comments, only: [:index, :create ,:destroy]
    end

    resource :session, only: [:create, :destroy]


  end

  root "static_pages#root"

end