Commit be176cdf42a5c3bf7e723cd7f8edccaa92023987

Authored by Rafael Manzo
Committed by Eduardo Silva Araújo
1 parent 630db0a1
Exists in colab

[Colab] Routes scoped as expected by colab with '/mezuro'

Signed off by: Gustavo Jaruga <darksshades@hotmail.com>
Showing 2 changed files with 38 additions and 39 deletions   Show diff stats
config/environments/colab.rb
@@ -47,4 +47,5 @@ Rails.application.configure do @@ -47,4 +47,5 @@ Rails.application.configure do
47 47
48 # Responds on a subdirectory 48 # Responds on a subdirectory
49 config.relative_url_root = '/mezuro' 49 config.relative_url_root = '/mezuro'
  50 + config.assets.prefix = '/mezuro'
50 end 51 end
config/routes.rb
1 Rails.application.routes.draw do 1 Rails.application.routes.draw do
2 - scope "(:locale)", locale: /en|pt/ do  
3 - # We need to manually define OmniAuth routes since the automatic generation does not support the dynamic scope  
4 - devise_for :users, skip: :omniauth_callbacks  
5 - get 'users/:user_id/projects' => 'users#projects', as: :user_projects  
6 -  
7 - resources :projects do  
8 - resources :repositories, only: [:new, :create]  
9 - end 2 + scope "mezuro" do
  3 + scope "(:locale)", locale: /en|pt/ do
  4 + # We need to manually define OmniAuth routes since the automatic generation does not support the dynamic scope
  5 + devise_for :users, skip: :omniauth_callbacks
  6 + get 'users/:user_id/projects' => 'users#projects', as: :user_projects
  7 +
  8 + resources :projects do
  9 + resources :repositories, only: [:new, :create]
  10 + end
10 11
11 - resources :repositories, except: [:update]  
12 - get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module  
13 - get '/repositories/:id/state' => 'repositories#state', as: :repository_state  
14 - get '/repositories/:id/state_with_date' => 'repositories#state_with_date', as: :repository_state_with_date  
15 - put '/repositories/:id' => 'repositories#update', as: :repository_update 12 + resources :repositories, except: [:update]
  13 + get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module
  14 + get '/repositories/:id/state' => 'repositories#state', as: :repository_state
  15 + get '/repositories/:id/state_with_date' => 'repositories#state_with_date', as: :repository_state_with_date
  16 + put '/repositories/:id' => 'repositories#update', as: :repository_update
16 # This route should be a POST to be semantically correct. But, RepositoriesController#create relies on a redirect to it which is not possible with a POST 17 # This route should be a POST to be semantically correct. But, RepositoriesController#create relies on a redirect to it which is not possible with a POST
17 - get '/repositories/:id/process' => 'repositories#process_repository', as: :repository_process 18 + get '/repositories/:id/process' => 'repositories#process_repository', as: :repository_process
18 get '/repository_branches' => 'repositories#branches', as: :repository_branches 19 get '/repository_branches' => 'repositories#branches', as: :repository_branches
19 20
20 - scope :format => false, :constraints => { :format => 'json' } do  
21 - post '/repositories/:id/notify_push' => 'repositories#notify_push', as: :repository_notify_push, format: :json  
22 - end 21 + resources :kalibro_configurations do
  22 + get '/metric_configurations/choose_metric' => 'metric_configurations#choose_metric', as: :choose_metric
  23 + resources :metric_configurations, except: [:update, :new] do
  24 + get '/kalibro_ranges/new' => 'kalibro_ranges#new', as: :new_kalibro_range
  25 + resources :kalibro_ranges, except: [:update, :new]
  26 + put '/kalibro_ranges/:id' => 'kalibro_ranges#update', as: :kalibro_range_update
  27 + end
  28 + post '/metric_configurations/new' => 'metric_configurations#new', as: :new_metric_configuration
  29 + put '/metric_configurations/:id' => 'metric_configurations#update', as: :metric_configuration_update
23 30
24 - resources :kalibro_configurations do  
25 - get '/metric_configurations/choose_metric' => 'metric_configurations#choose_metric', as: :choose_metric  
26 - resources :metric_configurations, except: [:update, :new] do  
27 - get '/kalibro_ranges/new' => 'kalibro_ranges#new', as: :new_kalibro_range  
28 - resources :kalibro_ranges, except: [:update, :new]  
29 - put '/kalibro_ranges/:id' => 'kalibro_ranges#update', as: :kalibro_range_update  
30 - end  
31 - post '/metric_configurations/new' => 'metric_configurations#new', as: :new_metric_configuration  
32 - put '/metric_configurations/:id' => 'metric_configurations#update', as: :metric_configuration_update  
33 -  
34 - resources :compound_metric_configurations, except: [:destroy, :update]  
35 - put '/compound_metric_configurations/:id' => 'compound_metric_configurations#update', as: :compound_metric_configuration_update 31 + resources :compound_metric_configurations, except: [:destroy, :update]
  32 + put '/compound_metric_configurations/:id' => 'compound_metric_configurations#update', as: :compound_metric_configuration_update
36 33
37 resources :hotspot_metric_configurations, only: [:create] 34 resources :hotspot_metric_configurations, only: [:create]
38 - end 35 + end
39 36
40 - resources :reading_groups do  
41 - resources :readings, except: [:index, :update, :show]  
42 - put '/readings/:id' => 'readings#update', as: :reading_update  
43 - end 37 + resources :reading_groups do
  38 + resources :readings, except: [:index, :update, :show]
  39 + put '/readings/:id' => 'readings#update', as: :reading_update
  40 + end
44 41
45 - # Modules  
46 - post '/modules/:id/metric_history' => 'modules#metric_history', as: 'module_metric_history'  
47 - post '/modules/:id/tree' => 'modules#load_module_tree', as: 'module_tree' 42 + # Modules
  43 + post '/modules/:id/metric_history' => 'modules#metric_history', as: 'module_metric_history'
  44 + post '/modules/:id/tree' => 'modules#load_module_tree', as: 'module_tree'
48 45
49 - root "home#index" 46 + root "home#index"
  47 + end
50 end 48 end
51 49
52 -  
53 # See comment above for devise_for 50 # See comment above for devise_for
54 devise_for :users, only: :omniauth_callbacks, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } 51 devise_for :users, only: :omniauth_callbacks, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
  52 +
55 # The priority is based upon order of creation: first created -> highest priority. 53 # The priority is based upon order of creation: first created -> highest priority.
56 # See how all your routes lay out with "rake routes". 54 # See how all your routes lay out with "rake routes".
57 55