aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/source/caching_with_rails.md7
-rw-r--r--guides/source/contributing_to_ruby_on_rails.md2
2 files changed, 7 insertions, 2 deletions
diff --git a/guides/source/caching_with_rails.md b/guides/source/caching_with_rails.md
index 0902e347e2..d0f3a596fe 100644
--- a/guides/source/caching_with_rails.md
+++ b/guides/source/caching_with_rails.md
@@ -353,7 +353,12 @@ Instead of an options hash, you can also simply pass in a model, Rails will use
class ProductsController < ApplicationController
def show
@product = Product.find(params[:id])
- respond_with(@product) if stale?(@product)
+
+ if stale?(@product)
+ respond_to do |wants|
+ # ... normal response processing
+ end
+ end
end
end
```
diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md
index 0b05725623..8bc4b10591 100644
--- a/guides/source/contributing_to_ruby_on_rails.md
+++ b/guides/source/contributing_to_ruby_on_rails.md
@@ -397,7 +397,7 @@ inside, just indent it with 4 spaces:
class ArticlesController
def index
- respond_with Article.limit(10)
+ render json: Article.limit(10)
end
end