Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #9019 from senny/doc_custom_rails_env

document how to create custom rails environments
  • Loading branch information...
commit d812ad8aa287edb3d8d222861e78203f8e6dfecc 2 parents 5984894 + 7e6e4f2
@fxn fxn authored
View
2  guides/source/action_mailer_basics.md
@@ -594,4 +594,4 @@ Before the interceptor can do its job you need to register it with the Action Ma
ActionMailer::Base.register_interceptor(SandboxEmailInterceptor) if Rails.env.staging?
```
-NOTE: The example above uses a custom environment called "staging" for a production like server but for testing purposes.
+NOTE: The example above uses a custom environment called "staging" for a production like server but for testing purposes. You can read [Creating Rails environments](./configuring.html#creating-rails-environments) for more information about custom Rails environments.
View
7 guides/source/configuring.md
@@ -552,6 +552,13 @@ development:
Change the username and password in the `development` section as appropriate.
+### Creating Rails environments
+
+By default Rails ships with three environments (production, development and test). While these are sufficient for most use cases, there are circumstances when you want more environments. Imagine you have a server, which mirrors the production environment but is only used for testing. You can create a separate environment for this server by creating a file called `config/environments/staging.rb`. This will create a new environment called "staging". You can use the contents of any existing file in `config/environments` as a starting point and make the necessary changes from there.
+
+After you created the environment file you can now start a server with `rails server -e staging` or a console with `rails console staging`
+
+
Rails Environment Settings
--------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.