From dcf401e3bc7163aefab856abe7f1d238025c4ef9 Mon Sep 17 00:00:00 2001 From: Will Gray Date: Fri, 9 Nov 2012 15:10:39 -0600 Subject: Update guides/source/rails_application_templates.md Add `#environment` --- guides/source/rails_application_templates.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'guides/source') diff --git a/guides/source/rails_application_templates.md b/guides/source/rails_application_templates.md index c3d4c4901e..20944ab258 100644 --- a/guides/source/rails_application_templates.md +++ b/guides/source/rails_application_templates.md @@ -85,6 +85,18 @@ For example, if you need to source a gem from "http://code.whytheluckystiff.net" add_source "http://code.whytheluckystiff.net" ``` +### environment/application(data=nil, options={}, &block) + +Adds a line inside the `Application` class for `config/application.rb`. + +If options `:env` is specified, the line is appended to the corresponding file in `config/environments`. + +```ruby +environment 'config.action_mailer.default_url_options = { :host => 'http://yourwebsite.example.com' }, :env => 'production' +``` + +A block can be used in place of the `data` argument. + ### vendor/lib/file/initializer(filename, data = nil, &block) Adds an initializer to the generated application’s `config/initializers` directory. -- cgit v1.2.3