diff options
author | Xavier Noria <fxn@hashref.com> | 2010-08-26 01:56:56 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-08-26 01:56:56 +0200 |
commit | 366e0fbd8d9bf1b5865edb930e795a17e5547a43 (patch) | |
tree | 2ed3954de218ea23b935bc781b0ea7c3fe613002 | |
parent | ee7507b38e14c39dd21aef581cffbe5dc3bd273b (diff) | |
download | rails-366e0fbd8d9bf1b5865edb930e795a17e5547a43.tar.gz rails-366e0fbd8d9bf1b5865edb930e795a17e5547a43.tar.bz2 rails-366e0fbd8d9bf1b5865edb930e795a17e5547a43.zip |
Revert "to_json => as_json"
This reverts commit 7a6d8e4ad47d571541762a6c80cc3e1f6831bd40.
Reason: The method that gives you a Ruby string with JSON source code is #to_json
-rw-r--r-- | railties/guides/source/action_view_overview.textile | 2 | ||||
-rw-r--r-- | railties/guides/source/layouts_and_rendering.textile | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index cd3c0a1b7b..e242cdaf73 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -1380,7 +1380,7 @@ page.insert_html :bottom, 'my_list', '<li>Last item</li>' h5. literal -Returns an object whose as_json evaluates to the code provided. Use this to pass a literal JavaScript expression as an argument to another JavaScriptGenerator method. +Returns an object whose to_json evaluates to the code provided. Use this to pass a literal JavaScript expression as an argument to another JavaScriptGenerator method. h5. redirect_to diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 1bef4d2145..fe5b4c8773 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -285,7 +285,7 @@ JSON is a javascript data format used by many AJAX libraries. Rails has built-in render :json => @product </ruby> -TIP: You don't need to call +as_json+ on the object that you want to render. If you use the +:json+ option, +render+ will automatically call +as_json+ for you. +TIP: You don't need to call +to_json+ on the object that you want to render. If you use the +:json+ option, +render+ will automatically call +to_json+ for you. h5. Rendering XML |