add conditional redirect
This commit is contained in:
parent
a367f0a376
commit
510465c9a3
|
|
@ -478,5 +478,10 @@ if defined?(Bundler)
|
|||
config.rating_dialog_min_num = 1
|
||||
|
||||
config.gcp_stats_host = "https://us-central1-tough-craft-276813.cloudfunctions.net"
|
||||
|
||||
config.root_redirect_on = true
|
||||
config.root_redirect_subdomain = ''
|
||||
config.root_redirect_path = '/'
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -111,4 +111,5 @@ SampleApp::Application.configure do
|
|||
|
||||
config.rating_dialog_min_time = 1
|
||||
config.rating_dialog_min_num = 1
|
||||
config.root_redirect_on = false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,14 @@ Rails.application.routes.draw do
|
|||
resources :users
|
||||
resources :sessions, only: [:new, :create, :destroy]
|
||||
|
||||
root to: 'users#home'
|
||||
if Rails.application.config.root_redirect_on
|
||||
root to: redirect(subdomain: Rails.application.config.root_redirect_subdomain, path: Rails.application.config.root_redirect_path) # => foo.example.com/bar
|
||||
else
|
||||
root to: 'users#home'
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
# signup, and signup completed, related pages
|
||||
get '/signup', to: 'users#new'
|
||||
|
|
|
|||
Loading…
Reference in New Issue