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 62e4975..fb97c51 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