From c1acaba941b15950165a120cb615653951c7ce3b Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 26 Sep 2016 01:02:45 +0800 Subject: [PATCH] re-order config/routes.rb --- config/routes.rb | 83 +++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 4800780d..bdee276b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,6 +12,49 @@ Metamaps::Application.routes.draw do get :synapses 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 :v2, path: '/v2' do resources :maps, only: [:index, :create, :show, :update, :destroy] @@ -35,42 +78,6 @@ Metamaps::Application.routes.draw do 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: { registrations: 'users/registrations', passwords: 'users/passwords', @@ -84,10 +91,6 @@ Metamaps::Application.routes.draw do get 'join' => 'devise/registrations#new', :as => :new_user_registration_path 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 get 'load_url_title' end