require 'rails/application' module RouteScoper # Keep the rescue so that you can revert to not having a # subdirectory when in development and test modes def self.root Rails.application.config.root_directory rescue NameError '/' end end MagnetTesterAdmin::Application.routes.draw do scope RouteScoper.root do resource :session, only: :new root :to => 'awesome_rootness#show' end end