Reputation: 1428
Is it possible to create routes in Rails 4 that are only executed while the application is being run in dev mode?
Upvotes: 33
Views: 12408
Reputation: 4959
You can test for the environment by the if statement:
if Rails.env.development?
#what you want in development
end
You can put an else statement for other environment types.
This is similar to this question: Changing a Rails route based on deployment type
Upvotes: 69