Reputation: 2653
Is there any way to define different root url based on Rails environment. I want to set root :to => 'pages#index'
for development and staging environment and root :to => 'beta_pages#index'
for production environment.
Thanks in advance.
Upvotes: 2
Views: 567
Reputation: 34318
Yes, you can do that.
In your routes.rb
file:
if Rails.env.development? || Rails.env.staging?
root :to => 'pages#index'
elsif Rails.env.production?
root :to => 'beta_pages#index'
end
Upvotes: 4