From e8c3009c1651db507c6c6bfe5fd0cf27a7b30e3f Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Thu, 4 Jun 2015 17:42:52 -0300 Subject: [PATCH] Revert "[Colab] Optional subdirectory route" --- app/controllers/application_controller.rb | 12 ++---------- config/routes.rb | 6 ++---- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 74dd401..fcc316e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -16,25 +16,17 @@ class ApplicationController < ActionController::Base class << self # This is necessary for correct devise routing with locales: https://github.com/plataformatec/devise/wiki/How-To:--Redirect-with-locale-after-authentication-failure def default_url_options - default = {} - default.merge!(locale_options) - default.merge!(subdirectory_options) + locale_options end def locale_options { locale: I18n.locale } end - - def subdirectory_options - { subdirectory: 'mezuro' } - end end # This happens after the *_url *_path helpers def default_url_options - default = {} - default.merge!(self.class.locale_options) - default.merge!(self.class.subdirectory_options) + self.class.locale_options end protected diff --git a/config/routes.rb b/config/routes.rb index ebe8dd0..caacf72 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Rails.application.routes.draw do - scope "/(:subdirectory)", subdirectory: /mezuro/ do + scope "mezuro" do scope "(:locale)", locale: /en|pt/ do # We need to manually define OmniAuth routes since the automatic generation does not support the dynamic scope devise_for :users, skip: :omniauth_callbacks @@ -43,10 +43,8 @@ Rails.application.routes.draw do post '/modules/:id/metric_history' => 'modules#metric_history', as: 'module_metric_history' post '/modules/:id/tree' => 'modules#load_module_tree', as: 'module_tree' - root "home#index", as: 'locale_root' + root "home#index" end - - root "home#index" end # See comment above for devise_for -- libgit2 0.21.2