Commit f2788c39f2f09cbb4e00fe26123a6fdca254435b

Authored by Rafael Manzo
1 parent 7ef94e36

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

Signed off by: Gustavo Jaruga <darksshades@hotmail.com>
Showing 2 changed files with 39 additions and 36 deletions   Show diff stats
config/environments/colab.rb
... ... @@ -47,4 +47,5 @@ Rails.application.configure do
47 47  
48 48 # Responds on a subdirectory
49 49 config.relative_url_root = '/mezuro'
  50 + config.assets.prefix = '/mezuro'
50 51 end
... ...
config/routes.rb
1 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, except: [:update, :index]
9   - get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module
10   - post '/repositories/:id/state' => 'repositories#state', as: :repository_state
11   - post '/repositories/:id/state_with_date' => 'repositories#state_with_date', as: :repository_state_with_date
12   - put '/repositories/:id' => 'repositories#update', as: :repository_update
13   - get '/repositories/:id/process' => 'repositories#process_repository', as: :repository_process
14   - end
15   -
16   - resources :kalibro_configurations do
17   - get '/metric_configurations/choose_metric' => 'metric_configurations#choose_metric', as: :choose_metric
18   - resources :metric_configurations, except: [:update, :new] do
19   - get '/kalibro_ranges/new' => 'kalibro_ranges#new', as: :new_kalibro_range
20   - resources :kalibro_ranges, except: [:update, :new]
21   - put '/kalibro_ranges/:id' => 'kalibro_ranges#update', as: :kalibro_range_update
  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, except: [:update, :index]
  10 + get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module
  11 + post '/repositories/:id/state' => 'repositories#state', as: :repository_state
  12 + post '/repositories/:id/state_with_date' => 'repositories#state_with_date', as: :repository_state_with_date
  13 + put '/repositories/:id' => 'repositories#update', as: :repository_update
  14 + get '/repositories/:id/process' => 'repositories#process_repository', as: :repository_process
22 15 end
23   - post '/metric_configurations/new' => 'metric_configurations#new', as: :new_metric_configuration
24   - put '/metric_configurations/:id' => 'metric_configurations#update', as: :metric_configuration_update
25 16  
26   - resources :compound_metric_configurations, except: [:destroy, :update]
27   - put '/compound_metric_configurations/:id' => 'compound_metric_configurations#update', as: :compound_metric_configuration_update
28   - end
  17 + resources :kalibro_configurations do
  18 + get '/metric_configurations/choose_metric' => 'metric_configurations#choose_metric', as: :choose_metric
  19 + resources :metric_configurations, except: [:update, :new] do
  20 + get '/kalibro_ranges/new' => 'kalibro_ranges#new', as: :new_kalibro_range
  21 + resources :kalibro_ranges, except: [:update, :new]
  22 + put '/kalibro_ranges/:id' => 'kalibro_ranges#update', as: :kalibro_range_update
  23 + end
  24 + post '/metric_configurations/new' => 'metric_configurations#new', as: :new_metric_configuration
  25 + put '/metric_configurations/:id' => 'metric_configurations#update', as: :metric_configuration_update
  26 +
  27 + resources :compound_metric_configurations, except: [:destroy, :update]
  28 + put '/compound_metric_configurations/:id' => 'compound_metric_configurations#update', as: :compound_metric_configuration_update
  29 + end
29 30  
30   - resources :reading_groups do
31   - resources :readings, except: [:index, :update, :show]
32   - put '/readings/:id' => 'readings#update', as: :reading_update
33   - end
  31 + resources :reading_groups do
  32 + resources :readings, except: [:index, :update, :show]
  33 + put '/readings/:id' => 'readings#update', as: :reading_update
  34 + end
34 35  
35   - #resources :modules
36   - post '/modules/:id/metric_history' => 'modules#metric_history'
37   - post '/modules/:id/tree' => 'modules#load_module_tree'
  36 + #resources :modules
  37 + post '/modules/:id/metric_history' => 'modules#metric_history'
  38 + post '/modules/:id/tree' => 'modules#load_module_tree'
38 39  
39   - # Tutorials
40   - get '/tutorials/:name' => 'tutorials#view', as: 'tutorials'
  40 + # Tutorials
  41 + get '/tutorials/:name' => 'tutorials#view', as: 'tutorials'
41 42  
42   - root "home#index"
  43 + root "home#index"
  44 + end
43 45 end
44 46  
45   -
46 47 # See comment above for devise_for
47 48 devise_for :users, only: :omniauth_callbacks, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
  49 +
48 50 # The priority is based upon order of creation: first created -> highest priority.
49 51 # See how all your routes lay out with "rake routes".
50 52  
... ...