diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-11-12 08:18:50 -0600 |
---|---|---|
committer | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-11-12 08:18:50 -0600 |
commit | c2794b49575d919bdbce720a09f9441011813576 (patch) | |
tree | 008963721acca750b0caca97a66093e01d7a744a /railties/doc | |
parent | ef3672dddaf6171b2fd9ef5ecc4458e0349a486f (diff) | |
download | rails-c2794b49575d919bdbce720a09f9441011813576.tar.gz rails-c2794b49575d919bdbce720a09f9441011813576.tar.bz2 rails-c2794b49575d919bdbce720a09f9441011813576.zip |
Add :except and :only for resource routes to 2.2 release notes.
Diffstat (limited to 'railties/doc')
-rw-r--r-- | railties/doc/guides/source/2_2_release_notes.txt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/railties/doc/guides/source/2_2_release_notes.txt b/railties/doc/guides/source/2_2_release_notes.txt index c730f72748..f78c179ba1 100644 --- a/railties/doc/guides/source/2_2_release_notes.txt +++ b/railties/doc/guides/source/2_2_release_notes.txt @@ -209,7 +209,7 @@ Active Record association proxies now respect the scope of methods on the proxie == Action Controller -On the controller side, there are a couple of changes that will help tidy up your routes. +On the controller side, there are several changes that will help tidy up your routes. There are also some internal changes in the routing engine to lower memory usage on complex applications. === Shallow Route Nesting @@ -250,7 +250,17 @@ map.resources :photos, :collection => { :search => [:get, :post] } * Lead Contributor: link:http://brennandunn.com/[Brennan Dunn] -Action Controller now offers good support for HTTP conditional GET requests, as well as some other additions. +=== Resources With Specific Actions + +By default, when you use +map.resources+ to create a route, Rails generates routes for seven default actions (index, show, create, new, edit, update, and destroy). But each of these routes takes up memory in your application, and causes Rails to generate additional routing logic. Now you can use the +:only+ and +:except+ options to fine-tune the routes that Rails will generate for resources. You can supply a single action, an array of actions, or the special +:all+ or +:none+ options. These options are inherited by nested resources. + +[source, ruby] +------------------------------------------------------- +map.resources :photos, :only => [:index, :show] +map.resources :products, :except => :destroy +------------------------------------------------------- + +* Lead Contributor: link:http://experthuman.com/[Tom Stuart] === Other Action Controller Changes |