diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-06-30 23:15:22 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-06-30 23:15:22 +0530 |
commit | 6b9d1a0db2f7829509689d244d6a5eda5210401d (patch) | |
tree | 2d4920fa5e2f3d8571573d5aee717cac261c53ac /guides/source | |
parent | 4662c5f4effd829099d647a7a76c7044fcc68121 (diff) | |
parent | 32c28e8214940fe6b06043b280e8d342e16eb3c6 (diff) | |
download | rails-6b9d1a0db2f7829509689d244d6a5eda5210401d.tar.gz rails-6b9d1a0db2f7829509689d244d6a5eda5210401d.tar.bz2 rails-6b9d1a0db2f7829509689d244d6a5eda5210401d.zip |
Merge branch 'master' of github.com:lifo/docrails
Conflicts:
activemodel/lib/active_model/errors.rb
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/debugging_rails_applications.textile | 2 | ||||
-rw-r--r-- | guides/source/getting_started.textile | 4 | ||||
-rw-r--r-- | guides/source/performance_testing.textile | 6 | ||||
-rw-r--r-- | guides/source/routing.textile | 8 |
4 files changed, 13 insertions, 7 deletions
diff --git a/guides/source/debugging_rails_applications.textile b/guides/source/debugging_rails_applications.textile index 0802a2db26..cc172042e9 100644 --- a/guides/source/debugging_rails_applications.textile +++ b/guides/source/debugging_rails_applications.textile @@ -102,7 +102,7 @@ It can also be useful to save information to log files at runtime. Rails maintai h4. What is the Logger? -Rails makes use of Ruby's standard +logger+ to write log information. You can also substitute another logger such as +Log4r+ if you wish. +Rails makes use of the +ActiveSupport::BufferedLogger+ class to write log information. You can also substitute another logger such as +Log4r+ if you wish. You can specify an alternative logger in your +environment.rb+ or any environment file: diff --git a/guides/source/getting_started.textile b/guides/source/getting_started.textile index 897327a888..07419d11b4 100644 --- a/guides/source/getting_started.textile +++ b/guides/source/getting_started.textile @@ -900,7 +900,7 @@ end </ruby> The new method, +update_attributes+, is used when you want to update a record -that already exists, and it accepts an hash containing the attributes +that already exists, and it accepts a hash containing the attributes that you want to update. As before, if there was an error updating the post we want to show the form back to the user. @@ -1185,7 +1185,7 @@ delete "posts/:id" => "posts#destroy" That's a lot to type for covering a single *resource*. Fortunately, Rails provides a +resources+ method which can be used to declare a -standard REST resource. Here's how +config/routes/rb+ looks after the +standard REST resource. Here's how +config/routes.rb+ looks after the cleanup: <ruby> diff --git a/guides/source/performance_testing.textile b/guides/source/performance_testing.textile index 958b13cd9e..982fd1b070 100644 --- a/guides/source/performance_testing.textile +++ b/guides/source/performance_testing.textile @@ -524,11 +524,11 @@ Please refer to the "API docs":http://api.rubyonrails.org/classes/ActiveRecord/B h4. Controller -Similarly, you could use this helper method inside "controllers":http://api.rubyonrails.org/classes/ActionController/Benchmarking/ClassMethods.html#M000715 +Similarly, you could use this helper method inside "controllers":http://api.rubyonrails.org/classes/ActiveSupport/Benchmarkable.html <ruby> def process_projects - self.class.benchmark("Processing projects") do + benchmark("Processing projects") do Project.process(params[:project_ids]) Project.update_cached_projects end @@ -539,7 +539,7 @@ NOTE: +benchmark+ is a class method inside controllers h4. View -And in "views":http://api.rubyonrails.org/classes/ActionController/Benchmarking/ClassMethods.html#M000715: +And in "views":http://api.rubyonrails.org/classes/ActiveSupport/Benchmarkable.html: <erb> <% benchmark("Showing projects partial") do %> diff --git a/guides/source/routing.textile b/guides/source/routing.textile index 4de76ff100..cffbf9bec4 100644 --- a/guides/source/routing.textile +++ b/guides/source/routing.textile @@ -32,7 +32,13 @@ the request is dispatched to the +patients+ controller's +show+ action with <tt> h4. Generating Paths and URLs from Code -You can also generate paths and URLs. If your application contains this code: +You can also generate paths and URLs. If the route above is modified to be + +<ruby> +get "/patients/:id" => "patients#show", :as => "patient" +</ruby> + +If your application contains this code: <ruby> @patient = Patient.find(17) |