diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2014-08-17 13:21:28 -0400 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2014-08-17 13:21:28 -0400 |
commit | bf5b6969682394c3f71daa6e9962c86f4bf71059 (patch) | |
tree | 66e0eb4b506ad92b8ee3c03fc2a8a57f8ed6a8b3 /guides | |
parent | aee1ba42339df2baf6b44af01f270ae2d37863e1 (diff) | |
parent | 57f5b00ba4f675873d5bab3bc88dae55d4fe7857 (diff) | |
download | rails-bf5b6969682394c3f71daa6e9962c86f4bf71059.tar.gz rails-bf5b6969682394c3f71daa6e9962c86f4bf71059.tar.bz2 rails-bf5b6969682394c3f71daa6e9962c86f4bf71059.zip |
Merge pull request #16526 from rails/jv-no-responders
Move respond_with to the responders gem
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/caching_with_rails.md | 7 | ||||
-rw-r--r-- | guides/source/contributing_to_ruby_on_rails.md | 2 |
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 |