From 2110a524a4913815d036786aa01319fd67db0ee2 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 16 Oct 2009 12:49:39 -0700 Subject: Deprecate RAILS_ROOT in favor of Rails.root (which proxies to the application's object root) --- railties/guides/source/2_2_release_notes.textile | 2 +- railties/guides/source/action_controller_overview.textile | 2 +- railties/guides/source/command_line.textile | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/2_2_release_notes.textile b/railties/guides/source/2_2_release_notes.textile index f60af01050..15a7bdbd44 100644 --- a/railties/guides/source/2_2_release_notes.textile +++ b/railties/guides/source/2_2_release_notes.textile @@ -51,7 +51,7 @@ If you want to generate these guides locally, inside your application: rake doc:guides -This will put the guides inside +RAILS_ROOT/doc/guides+ and you may start surfing straight away by opening +RAILS_ROOT/doc/guides/index.html+ in your favourite browser. +This will put the guides inside +Rails.root/doc/guides+ and you may start surfing straight away by opening +Rails.root/doc/guides/index.html+ in your favourite browser. * Lead Contributors: "Rails Documentation Team":http://guides.rails.info/credits.html * Major contributions from "Xavier Noria":http://advogato.org/person/fxn/diary.html and "Hongli Lai":http://izumi.plan99.net/blog/. diff --git a/railties/guides/source/action_controller_overview.textile b/railties/guides/source/action_controller_overview.textile index 756caea5fe..46a28da8c4 100644 --- a/railties/guides/source/action_controller_overview.textile +++ b/railties/guides/source/action_controller_overview.textile @@ -653,7 +653,7 @@ class ClientsController < ApplicationController # Stream a file that has already been generated and stored on disk. def download_pdf client = Client.find(params[:id]) - send_data("#{RAILS_ROOT}/files/clients/#{client.id}.pdf", + send_data("#{Rails.root}/files/clients/#{client.id}.pdf", :filename => "#{client.name}.pdf", :type => "application/pdf") end diff --git a/railties/guides/source/command_line.textile b/railties/guides/source/command_line.textile index d042458419..1a571358a1 100644 --- a/railties/guides/source/command_line.textile +++ b/railties/guides/source/command_line.textile @@ -424,10 +424,10 @@ INFO: For a good rundown on generators, see "Understanding Generators":http://wi Generators are code that generates code. Let's experiment by building one. Our generator will generate a text file. -The Rails generator by default looks in these places for available generators, where RAILS_ROOT is the root of your Rails application, like /home/foobar/commandsapp: +The Rails generator by default looks in these places for available generators, where Rails.root is the root of your Rails application, like /home/foobar/commandsapp: -* RAILS_ROOT/lib/generators -* RAILS_ROOT/vendor/generators +* Rails.root/lib/generators +* Rails.root/vendor/generators * Inside any plugin with a directory like "generators" or "rails_generators" * ~/.rails/generators * Inside any Gem you have installed with a name ending in "_generator" @@ -465,7 +465,7 @@ We take whatever args are supplied, save them to an instance variable, and liter * Check there's a *public* directory. You bet there is. * Run the ERb template called "tutorial.erb". -* Save it into "RAILS_ROOT/public/tutorial.txt". +* Save it into "Rails.root/public/tutorial.txt". * Pass in the arguments we saved through the +:assign+ parameter. Next we'll build the template: -- cgit v1.2.3