diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-11-01 06:14:02 -0500 |
---|---|---|
committer | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-11-01 06:14:02 -0500 |
commit | 1d84c158c1aff15149a91b86f44138d96e417134 (patch) | |
tree | adb1117c4c6f6fc66340b648d154586572b2e2a1 /railties/doc/guides/source | |
parent | 4bb13a2bfb7a2fc666c74038c1e72ea10544dfae (diff) | |
download | rails-1d84c158c1aff15149a91b86f44138d96e417134.tar.gz rails-1d84c158c1aff15149a91b86f44138d96e417134.tar.bz2 rails-1d84c158c1aff15149a91b86f44138d96e417134.zip |
Update 2.2 relnotes & Layouts/Rendering Guide to include render :js
Diffstat (limited to 'railties/doc/guides/source')
-rw-r--r-- | railties/doc/guides/source/2_2_release_notes.txt | 3 | ||||
-rw-r--r-- | railties/doc/guides/source/layouts_and_rendering.txt | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/railties/doc/guides/source/2_2_release_notes.txt b/railties/doc/guides/source/2_2_release_notes.txt index c49b85e737..2e9e9b8aa1 100644 --- a/railties/doc/guides/source/2_2_release_notes.txt +++ b/railties/doc/guides/source/2_2_release_notes.txt @@ -257,7 +257,8 @@ Action Controller now offers good support for HTTP conditional GET requests, as * The HTTP Accept header is disabled by default now. You should prefer the use of formatted URLs (such as +/customers/1.xml+) to indicate the format that you want. If you need the Accept headers, you can turn them back on with +config.action_controller.user_accept_header = true+. * Benchmarking numbers are now reported in milliseconds rather than tiny fractions of seconds * Rails now supports HTTP-only cookies (and uses them for sessions), which help mitigate some cross-site scripting risks in newer browsers. -* +redirect_to+ now fully supports URI schemes (so, for example, you can redirect to a svn+ssh: URI) +* +redirect_to+ now fully supports URI schemes (so, for example, you can redirect to a svn+ssh: URI). +* +render+ now supports a +:js+ option to render plain vanilla javascript with the right mime type. == Action View diff --git a/railties/doc/guides/source/layouts_and_rendering.txt b/railties/doc/guides/source/layouts_and_rendering.txt index 0c8ed43e26..4211f9a0b5 100644 --- a/railties/doc/guides/source/layouts_and_rendering.txt +++ b/railties/doc/guides/source/layouts_and_rendering.txt @@ -166,6 +166,17 @@ render :xml => @product TIP: You don't need to call +to_xml+ on the object that you want to render. If you use the +:xml+ option, +render+ will automatically call +to_xml+ for you. +==== Rendering Vanilla JavaScript + +Rails can render vanilla JavaScript (as an alternative to using +update+ with n +.rjs+ file): + +[source, ruby] +------------------------------------------------------- +render :js => "alert('Hello Rails');" +------------------------------------------------------- + +This will send the supplied string to the browser with a MIME type of +text/javascript+. + ==== Options for +render+ Calls to the +render+ method generally accept four options: @@ -885,6 +896,7 @@ In this case, Rails will use the customer or employee partials as appropriate fo http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/15[Lighthouse ticket] +* November 1, 2008: Added +:js+ option for +render+ by link:../authors.html#mgunderloy[Mike Gunderloy] * October 16, 2008: Ready for publication by link:../authors.html#mgunderloy[Mike Gunderloy] * October 4, 2008: Additional info on partials (+:object+, +:as+, and +:spacer_template+) by link:../authors.html#mgunderloy[Mike Gunderloy] (not yet approved for publication) * September 28, 2008: First draft by link:../authors.html#mgunderloy[Mike Gunderloy] (not yet approved for publication) |