From 7541a31cc2a5e10d5c90770d043e485a5b487de1 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 1b85a30..334c08b 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 aefd4ca..481ee03 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 @@ -46,10 +46,8 @@ Rails.application.routes.draw do # Tutorials get '/tutorials/:name' => 'tutorials#view', as: 'tutorials' - root "home#index", as: 'locale_root' + root "home#index" end - - root "home#index" end # See comment above for devise_for -- libgit2 0.21.2