Commit 0edc145a6d291592c092044876c84ef38033618f

Authored by Rafael Manzo
1 parent 299c12e6

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

This reverts commit f2788c39f2f09cbb4e00fe26123a6fdca254435b.

The right way to set the subdirectory is by setting the Rack mount on config.ru
or on the webserver like apache or nginx.
Showing 2 changed files with 28 additions and 31 deletions   Show diff stats
config/environments/colab.rb
@@ -47,5 +47,4 @@ Rails.application.configure do @@ -47,5 +47,4 @@ 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'  
51 end 50 end
config/routes.rb
1 Rails.application.routes.draw do 1 Rails.application.routes.draw do
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 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
11 10
12 resources :repositories, except: [:update] 11 resources :repositories, except: [:update]
13 get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module 12 get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module
@@ -19,39 +18,38 @@ Rails.application.routes.draw do @@ -19,39 +18,38 @@ Rails.application.routes.draw do
19 18
20 get '/repository_branches' => 'repositories#branches', as: :repository_branches 19 get '/repository_branches' => 'repositories#branches', as: :repository_branches
21 20
22 - resources :kalibro_configurations do  
23 - get '/metric_configurations/choose_metric' => 'metric_configurations#choose_metric', as: :choose_metric  
24 - resources :metric_configurations, except: [:update, :new] do  
25 - get '/kalibro_ranges/new' => 'kalibro_ranges#new', as: :new_kalibro_range  
26 - resources :kalibro_ranges, except: [:update, :new]  
27 - put '/kalibro_ranges/:id' => 'kalibro_ranges#update', as: :kalibro_range_update  
28 - end  
29 - post '/metric_configurations/new' => 'metric_configurations#new', as: :new_metric_configuration  
30 - put '/metric_configurations/:id' => 'metric_configurations#update', as: :metric_configuration_update  
31 -  
32 - resources :compound_metric_configurations, except: [:destroy, :update]  
33 - put '/compound_metric_configurations/:id' => 'compound_metric_configurations#update', as: :compound_metric_configuration_update 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
34 end 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
35 30
36 - resources :reading_groups do  
37 - resources :readings, except: [:index, :update, :show]  
38 - put '/readings/:id' => 'readings#update', as: :reading_update  
39 - end 31 + resources :compound_metric_configurations, except: [:destroy, :update]
  32 + put '/compound_metric_configurations/:id' => 'compound_metric_configurations#update', as: :compound_metric_configuration_update
  33 + end
  34 +
  35 + resources :reading_groups do
  36 + resources :readings, except: [:index, :update, :show]
  37 + put '/readings/:id' => 'readings#update', as: :reading_update
  38 + end
40 39
41 # Modules 40 # Modules
42 post '/modules/:id/metric_history' => 'modules#metric_history', as: 'module_metric_history' 41 post '/modules/:id/metric_history' => 'modules#metric_history', as: 'module_metric_history'
43 post '/modules/:id/tree' => 'modules#load_module_tree', as: 'module_tree' 42 post '/modules/:id/tree' => 'modules#load_module_tree', as: 'module_tree'
44 43
45 - # Tutorials  
46 - get '/tutorials/:name' => 'tutorials#view', as: 'tutorials' 44 + # Tutorials
  45 + get '/tutorials/:name' => 'tutorials#view', as: 'tutorials'
47 46
48 - root "home#index"  
49 - end 47 + root "home#index"
50 end 48 end
51 49
  50 +
52 # See comment above for devise_for 51 # See comment above for devise_for
53 devise_for :users, only: :omniauth_callbacks, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } 52 devise_for :users, only: :omniauth_callbacks, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
54 -  
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