re-order config/routes.rb

This commit is contained in:
Devin Howard 2016-09-26 01:02:45 +08:00
parent 5b9eedc830
commit c1acaba941

View file

@ -12,6 +12,49 @@ Metamaps::Application.routes.draw do
get :synapses get :synapses
end end
namespace :explore do
get 'active'
get 'featured'
get 'mine'
get 'shared'
get 'starred'
get 'mapper/:id', action: 'mapper'
end
resources :maps, except: [:index, :edit] do
member do
get :export
post 'events/:event', action: :events
get :contains
post :upload_screenshot, action: :screenshot
post :access, default: { format: :json }
post :star, to: 'stars#create', defaults: { format: :json }
post :unstar, to: 'stars#destroy', defaults: { format: :json }
end
end
resources :mappings, except: [:index, :new, :edit]
resources :messages, only: [:show, :create, :update, :destroy]
resources :metacode_sets, except: [:show]
resources :metacodes, except: [:destroy]
get 'metacodes/:name', to: 'metacodes#show'
resources :synapses, except: [:index, :new, :edit]
resources :topics, except: [:index, :new, :edit] do
get :autocomplete_topic, on: :collection
end
get 'topics/:id/network', to: 'topics#network', as: :network
get 'topics/:id/relative_numbers', to: 'topics#relative_numbers', as: :relative_numbers
get 'topics/:id/relatives', to: 'topics#relatives', as: :relatives
resources :users, except: [:index, :destroy]
get 'users/:id/details', to: 'users#details', as: :details
post 'user/updatemetacodes', to: 'users#updatemetacodes', as: :updatemetacodes
namespace :api, path: '/api', default: { format: :json } do namespace :api, path: '/api', default: { format: :json } do
namespace :v2, path: '/v2' do namespace :v2, path: '/v2' do
resources :maps, only: [:index, :create, :show, :update, :destroy] resources :maps, only: [:index, :create, :show, :update, :destroy]
@ -35,42 +78,6 @@ Metamaps::Application.routes.draw do
end end
end end
resources :messages, only: [:show, :create, :update, :destroy]
resources :mappings, except: [:index, :new, :edit]
resources :metacode_sets, except: [:show]
resources :metacodes, except: [:destroy]
get 'metacodes/:name', to: 'metacodes#show'
resources :synapses, except: [:index, :new, :edit]
resources :topics, except: [:index, :new, :edit] do
get :autocomplete_topic, on: :collection
end
get 'topics/:id/network', to: 'topics#network', as: :network
get 'topics/:id/relative_numbers', to: 'topics#relative_numbers', as: :relative_numbers
get 'topics/:id/relatives', to: 'topics#relatives', as: :relatives
resources :maps, except: [:index, :edit] do
member do
get :export
post 'events/:event', action: :events
get :contains
post :upload_screenshot, action: :screenshot
post :access, default: { format: :json }
post :star, to: 'stars#create', defaults: { format: :json }
post :unstar, to: 'stars#destroy', defaults: { format: :json }
end
end
namespace :explore do
get 'active'
get 'featured'
get 'mine'
get 'shared'
get 'starred'
get 'mapper/:id', action: 'mapper'
end
devise_for :users, skip: :sessions, controllers: { devise_for :users, skip: :sessions, controllers: {
registrations: 'users/registrations', registrations: 'users/registrations',
passwords: 'users/passwords', passwords: 'users/passwords',
@ -84,10 +91,6 @@ Metamaps::Application.routes.draw do
get 'join' => 'devise/registrations#new', :as => :new_user_registration_path get 'join' => 'devise/registrations#new', :as => :new_user_registration_path
end end
get 'users/:id/details', to: 'users#details', as: :details
post 'user/updatemetacodes', to: 'users#updatemetacodes', as: :updatemetacodes
resources :users, except: [:index, :destroy]
namespace :hacks do namespace :hacks do
get 'load_url_title' get 'load_url_title'
end end