Skip to content

Commit 86b81aa

Browse files
committed
config/Set default host for staging envrionment
1 parent 66f4665 commit 86b81aa

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

config/routes.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
Rails.application.routes.draw do
2-
#TODO: works for development
3-
if Rails.env.development?
4-
Rails.application.routes.default_url_options[:host] = "localhost:3000"
5-
else
6-
Rails.application.routes.default_url_options[:host] = 'www.snippetsafe.com'
2+
3+
Rails.application.routes.default_url_options[:host] = if Rails.env.development?
4+
"localhost:3000"
5+
elsif Rails.env.staging?
6+
'www.snippet-safe-staging.herokuapp.com'
7+
elsif Rails.env.production?
8+
'www.snippetsafe.com'
79
end
810

911
devise_for :users, controllers: {

0 commit comments

Comments
 (0)