<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,19 @@
 *Edge*
 
+* Add support for shallow nesting of routes. #838 [S. Brent Faulkner]
+
+  Example :
+
+  map.resources :users, :shallow =&gt; true do |user|
+    user.resources :posts
+  end
+
+  - GET /users/1/posts (maps to PostsController#index action as usual)
+    named route &quot;user_posts&quot; is added as usual.
+
+  - GET /posts/2 (maps to PostsController#show action as if it were not nested)
+    Additionally, named route &quot;post&quot; is added too.
+
 * Added button_to_remote helper.  #3641 [Donald Piret, Tarmo T&#228;nav]
 
 * Deprecate render_component. Please use render_component plugin from http://github.com/rails/render_component/tree/master [Pratik]</diff>
      <filename>actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -85,16 +85,24 @@ module ActionController
         @new_path  ||= &quot;#{path}/#{new_action}&quot;
       end
 
+      def shallow_path_prefix
+        @shallow_path_prefix ||= &quot;#{path_prefix unless @options[:shallow]}&quot;
+      end
+
       def member_path
-        @member_path ||= &quot;#{path}/:id&quot;
+        @member_path ||= &quot;#{shallow_path_prefix}/#{path_segment}/:id&quot;
       end
 
       def nesting_path_prefix
-        @nesting_path_prefix ||= &quot;#{path}/:#{singular}_id&quot;
+        @nesting_path_prefix ||= &quot;#{shallow_path_prefix}/#{path_segment}/:#{singular}_id&quot;
+      end
+
+      def shallow_name_prefix
+        @shallow_name_prefix ||= &quot;#{name_prefix unless @options[:shallow]}&quot;
       end
 
       def nesting_name_prefix
-        &quot;#{name_prefix}#{singular}_&quot;
+        &quot;#{shallow_name_prefix}#{singular}_&quot;
       end
 
       def action_separator
@@ -141,6 +149,8 @@ module ActionController
         super
       end
 
+      alias_method :shallow_path_prefix, :path_prefix
+      alias_method :shallow_name_prefix, :name_prefix
       alias_method :member_path,         :path
       alias_method :nesting_path_prefix, :path
     end
@@ -318,6 +328,31 @@ module ActionController
     #   comments_url(@article)
     #   comment_url(@article, @comment)
     #
+    # * &lt;tt&gt;:shallow&lt;/tt&gt; - If true, paths for nested resources which reference a specific member
+    #   (ie. those with an :id parameter) will not use the parent path prefix or name prefix.
+    #
+    # The &lt;tt&gt;:shallow&lt;/tt&gt; option is inherited by any nested resource(s).
+    #
+    # For example, 'users', 'posts' and 'comments' all use shallow paths with the following nested resources:
+    #
+    #   map.resources :users, :shallow =&gt; true do |user|
+    #     user.resources :posts do |post|
+    #       post.resources :comments
+    #     end
+    #   end
+    #   # --&gt; GET /users/1/posts (maps to the PostsController#index action as usual)
+    #   #     also adds the usual named route called &quot;user_posts&quot;
+    #   # --&gt; GET /posts/2 (maps to the PostsController#show action as if it were not nested)
+    #   #     also adds the named route called &quot;post&quot;
+    #   # --&gt; GET /posts/2/comments (maps to the CommentsController#index action)
+    #   #     also adds the named route called &quot;post_comments&quot;
+    #   # --&gt; GET /comments/2 (maps to the CommentsController#show action as if it were not nested)
+    #   #     also adds the named route called &quot;comment&quot;
+    #
+    # You may also use &lt;tt&gt;:shallow&lt;/tt&gt; in combination with the +has_one+ and +has_many+ shorthand notations like:
+    #
+    #   map.resources :users, :has_many =&gt; { :posts =&gt; :comments }, :shallow =&gt; true
+    #
     # If &lt;tt&gt;map.resources&lt;/tt&gt; is called with multiple resources, they all get the same options applied.
     #
     # Examples:
@@ -443,7 +478,7 @@ module ActionController
           map_associations(resource, options)
 
           if block_given?
-            with_options(:path_prefix =&gt; resource.nesting_path_prefix, :name_prefix =&gt; resource.nesting_name_prefix, :namespace =&gt; options[:namespace], &amp;block)
+            with_options(:path_prefix =&gt; resource.nesting_path_prefix, :name_prefix =&gt; resource.nesting_name_prefix, :namespace =&gt; options[:namespace], :shallow =&gt; options[:shallow], &amp;block)
           end
         end
       end
@@ -460,21 +495,35 @@ module ActionController
           map_associations(resource, options)
 
           if block_given?
-            with_options(:path_prefix =&gt; resource.nesting_path_prefix, :name_prefix =&gt; resource.nesting_name_prefix, :namespace =&gt; options[:namespace], &amp;block)
+            with_options(:path_prefix =&gt; resource.nesting_path_prefix, :name_prefix =&gt; resource.nesting_name_prefix, :namespace =&gt; options[:namespace], :shallow =&gt; options[:shallow], &amp;block)
           end
         end
       end
 
       def map_associations(resource, options)
+        map_has_many_associations(resource, options.delete(:has_many), options) if options[:has_many]
+
         path_prefix = &quot;#{options.delete(:path_prefix)}#{resource.nesting_path_prefix}&quot;
         name_prefix = &quot;#{options.delete(:name_prefix)}#{resource.nesting_name_prefix}&quot;
 
-        Array(options[:has_many]).each do |association|
-          resources(association, :path_prefix =&gt; path_prefix, :name_prefix =&gt; name_prefix, :namespace =&gt; options[:namespace])
+        Array(options[:has_one]).each do |association|
+          resource(association, :path_prefix =&gt; path_prefix, :name_prefix =&gt; name_prefix, :namespace =&gt; options[:namespace], :shallow =&gt; options[:shallow])
         end
+      end
 
-        Array(options[:has_one]).each do |association|
-          resource(association, :path_prefix =&gt; path_prefix, :name_prefix =&gt; name_prefix, :namespace =&gt; options[:namespace])
+      def map_has_many_associations(resource, associations, options)
+        case associations
+        when Hash
+          associations.each do |association,has_many|
+            map_has_many_associations(resource, association, options.merge(:has_many =&gt; has_many))
+          end
+        when Array
+          associations.each do |association|
+            map_has_many_associations(resource, association, options)
+          end
+        when Symbol, String
+          resources(associations, :path_prefix =&gt; resource.nesting_path_prefix, :name_prefix =&gt; resource.nesting_name_prefix, :namespace =&gt; options[:namespace], :shallow =&gt; options[:shallow], :has_many =&gt; options[:has_many])
+        else
         end
       end
 
@@ -530,13 +579,13 @@ module ActionController
               action_path = resource.options[:path_names][action] if resource.options[:path_names].is_a?(Hash)
               action_path ||= Base.resources_path_names[action] || action
 
-              map_named_routes(map, &quot;#{action}_#{resource.name_prefix}#{resource.singular}&quot;, &quot;#{resource.member_path}#{resource.action_separator}#{action_path}&quot;, action_options)
+              map_named_routes(map, &quot;#{action}_#{resource.shallow_name_prefix}#{resource.singular}&quot;, &quot;#{resource.member_path}#{resource.action_separator}#{action_path}&quot;, action_options)
             end
           end
         end
 
         show_action_options = action_options_for(&quot;show&quot;, resource)
-        map_named_routes(map, &quot;#{resource.name_prefix}#{resource.singular}&quot;, resource.member_path, show_action_options)
+        map_named_routes(map, &quot;#{resource.shallow_name_prefix}#{resource.singular}&quot;, resource.member_path, show_action_options)
 
         update_action_options = action_options_for(&quot;update&quot;, resource)
         map_unnamed_routes(map, resource.member_path, update_action_options)
@@ -579,4 +628,4 @@ end
 
 class ActionController::Routing::RouteSet::Mapper
   include ActionController::Resources
-end
\ No newline at end of file
+end</diff>
      <filename>actionpack/lib/action_controller/resources.rb</filename>
    </modified>
    <modified>
      <diff>@@ -379,6 +379,31 @@ class ResourcesTest &lt; Test::Unit::TestCase
     end
   end
 
+  def test_shallow_nested_restful_routes
+    with_routing do |set|
+      set.draw do |map|
+        map.resources :threads, :shallow =&gt; true do |map|
+          map.resources :messages do |map|
+            map.resources :comments
+          end
+        end
+      end
+
+      assert_simply_restful_for :threads,
+        :shallow =&gt; true
+      assert_simply_restful_for :messages,
+        :name_prefix =&gt; 'thread_',
+        :path_prefix =&gt; 'threads/1/',
+        :shallow =&gt; true,
+        :options =&gt; { :thread_id =&gt; '1' }
+      assert_simply_restful_for :comments,
+        :name_prefix =&gt; 'message_',
+        :path_prefix =&gt; 'messages/2/',
+        :shallow =&gt; true,
+        :options =&gt; { :message_id =&gt; '2' }
+    end
+  end
+
   def test_restful_routes_dont_generate_duplicates
     with_restful_routing :messages do
       routes = ActionController::Routing::Routes.routes
@@ -429,6 +454,32 @@ class ResourcesTest &lt; Test::Unit::TestCase
     end
   end
 
+  def test_resources_has_many_hash_should_become_nested_resources
+    with_routing do |set|
+      set.draw do |map|
+        map.resources :threads, :has_many =&gt; { :messages =&gt; [ :comments, { :authors =&gt; :threads } ] }
+      end
+
+      assert_simply_restful_for :threads
+      assert_simply_restful_for :messages, :name_prefix =&gt; &quot;thread_&quot;, :path_prefix =&gt; 'threads/1/', :options =&gt; { :thread_id =&gt; '1' }
+      assert_simply_restful_for :comments, :name_prefix =&gt; &quot;thread_message_&quot;, :path_prefix =&gt; 'threads/1/messages/1/', :options =&gt; { :thread_id =&gt; '1', :message_id =&gt; '1' }
+      assert_simply_restful_for :authors,  :name_prefix =&gt; &quot;thread_message_&quot;, :path_prefix =&gt; 'threads/1/messages/1/', :options =&gt; { :thread_id =&gt; '1', :message_id =&gt; '1' }
+      assert_simply_restful_for :threads,  :name_prefix =&gt; &quot;thread_message_author_&quot;, :path_prefix =&gt; 'threads/1/messages/1/authors/1/', :options =&gt; { :thread_id =&gt; '1', :message_id =&gt; '1', :author_id =&gt; '1' }
+    end
+  end
+
+  def test_shallow_resource_has_many_should_become_shallow_nested_resources
+    with_routing do |set|
+      set.draw do |map|
+        map.resources :messages, :has_many =&gt; [ :comments, :authors ], :shallow =&gt; true
+      end
+
+      assert_simply_restful_for :messages, :shallow =&gt; true
+      assert_simply_restful_for :comments, :name_prefix =&gt; &quot;message_&quot;, :path_prefix =&gt; 'messages/1/', :shallow =&gt; true, :options =&gt; { :message_id =&gt; '1' }
+      assert_simply_restful_for :authors,  :name_prefix =&gt; &quot;message_&quot;, :path_prefix =&gt; 'messages/1/', :shallow =&gt; true, :options =&gt; { :message_id =&gt; '1' }
+    end
+  end
+
   def test_resource_has_one_should_become_nested_resources
     with_routing do |set|
       set.draw do |map|
@@ -440,6 +491,17 @@ class ResourcesTest &lt; Test::Unit::TestCase
     end
   end
 
+  def test_shallow_resource_has_one_should_become_shallow_nested_resources
+    with_routing do |set|
+      set.draw do |map|
+        map.resources :messages, :has_one =&gt; :logo, :shallow =&gt; true
+      end
+
+      assert_simply_restful_for :messages, :shallow =&gt; true
+      assert_singleton_restful_for :logo, :name_prefix =&gt; 'message_', :path_prefix =&gt; 'messages/1/', :shallow =&gt; true, :options =&gt; { :message_id =&gt; '1' }
+    end
+  end
+
   def test_singleton_resource_with_member_action
     [:put, :post].each do |method|
       with_singleton_resources :account, :member =&gt; { :reset =&gt; method } do
@@ -744,6 +806,13 @@ class ResourcesTest &lt; Test::Unit::TestCase
       options[:options] ||= {}
       options[:options][:controller] = options[:controller] || controller_name.to_s
 
+      if options[:shallow]
+        options[:shallow_options] ||= {}
+        options[:shallow_options][:controller] = options[:options][:controller]
+      else
+        options[:shallow_options] = options[:options]
+      end
+
       new_action    = ActionController::Base.resources_path_names[:new] || &quot;new&quot;
       edit_action   = ActionController::Base.resources_path_names[:edit] || &quot;edit&quot;
       if options[:path_names]
@@ -751,8 +820,10 @@ class ResourcesTest &lt; Test::Unit::TestCase
         edit_action = options[:path_names][:edit] if options[:path_names][:edit]
       end
 
-      collection_path            = &quot;/#{options[:path_prefix]}#{options[:as] || controller_name}&quot;
-      member_path                = &quot;#{collection_path}/1&quot;
+      path                       = &quot;#{options[:as] || controller_name}&quot;
+      collection_path            = &quot;/#{options[:path_prefix]}#{path}&quot;
+      shallow_path               = &quot;/#{options[:path_prefix] unless options[:shallow]}#{path}&quot;
+      member_path                = &quot;#{shallow_path}/1&quot;
       new_path                   = &quot;#{collection_path}/#{new_action}&quot;
       edit_member_path           = &quot;#{member_path}/#{edit_action}&quot;
       formatted_edit_member_path = &quot;#{member_path}/#{edit_action}.xml&quot;
@@ -760,10 +831,13 @@ class ResourcesTest &lt; Test::Unit::TestCase
       with_options(options[:options]) do |controller|
         controller.assert_routing collection_path,            :action =&gt; 'index'
         controller.assert_routing new_path,                   :action =&gt; 'new'
-        controller.assert_routing member_path,                :action =&gt; 'show', :id =&gt; '1'
-        controller.assert_routing edit_member_path,           :action =&gt; 'edit', :id =&gt; '1'
         controller.assert_routing &quot;#{collection_path}.xml&quot;,   :action =&gt; 'index',            :format =&gt; 'xml'
         controller.assert_routing &quot;#{new_path}.xml&quot;,          :action =&gt; 'new',              :format =&gt; 'xml'
+      end
+
+      with_options(options[:shallow_options]) do |controller|
+        controller.assert_routing member_path,                :action =&gt; 'show', :id =&gt; '1'
+        controller.assert_routing edit_member_path,           :action =&gt; 'edit', :id =&gt; '1'
         controller.assert_routing &quot;#{member_path}.xml&quot;,       :action =&gt; 'show', :id =&gt; '1', :format =&gt; 'xml'
         controller.assert_routing formatted_edit_member_path, :action =&gt; 'edit', :id =&gt; '1', :format =&gt; 'xml'
       end
@@ -771,18 +845,18 @@ class ResourcesTest &lt; Test::Unit::TestCase
       assert_recognizes(options[:options].merge(:action =&gt; 'index'),               :path =&gt; collection_path,  :method =&gt; :get)
       assert_recognizes(options[:options].merge(:action =&gt; 'new'),                 :path =&gt; new_path,         :method =&gt; :get)
       assert_recognizes(options[:options].merge(:action =&gt; 'create'),              :path =&gt; collection_path,  :method =&gt; :post)
-      assert_recognizes(options[:options].merge(:action =&gt; 'show',    :id =&gt; '1'), :path =&gt; member_path,      :method =&gt; :get)
-      assert_recognizes(options[:options].merge(:action =&gt; 'edit',    :id =&gt; '1'), :path =&gt; edit_member_path, :method =&gt; :get)
-      assert_recognizes(options[:options].merge(:action =&gt; 'update',  :id =&gt; '1'), :path =&gt; member_path,      :method =&gt; :put)
-      assert_recognizes(options[:options].merge(:action =&gt; 'destroy', :id =&gt; '1'), :path =&gt; member_path,      :method =&gt; :delete)
-
-      assert_recognizes(options[:options].merge(:action =&gt; 'index',               :format =&gt; 'xml'), :path =&gt; &quot;#{collection_path}.xml&quot;,   :method =&gt; :get)
-      assert_recognizes(options[:options].merge(:action =&gt; 'new',                 :format =&gt; 'xml'), :path =&gt; &quot;#{new_path}.xml&quot;,          :method =&gt; :get)
-      assert_recognizes(options[:options].merge(:action =&gt; 'create',              :format =&gt; 'xml'), :path =&gt; &quot;#{collection_path}.xml&quot;,   :method =&gt; :post)
-      assert_recognizes(options[:options].merge(:action =&gt; 'show',    :id =&gt; '1', :format =&gt; 'xml'), :path =&gt; &quot;#{member_path}.xml&quot;,       :method =&gt; :get)
-      assert_recognizes(options[:options].merge(:action =&gt; 'edit',    :id =&gt; '1', :format =&gt; 'xml'), :path =&gt; formatted_edit_member_path, :method =&gt; :get)
-      assert_recognizes(options[:options].merge(:action =&gt; 'update',  :id =&gt; '1', :format =&gt; 'xml'), :path =&gt; &quot;#{member_path}.xml&quot;,       :method =&gt; :put)
-      assert_recognizes(options[:options].merge(:action =&gt; 'destroy', :id =&gt; '1', :format =&gt; 'xml'), :path =&gt; &quot;#{member_path}.xml&quot;,       :method =&gt; :delete)
+      assert_recognizes(options[:shallow_options].merge(:action =&gt; 'show',    :id =&gt; '1'), :path =&gt; member_path,      :method =&gt; :get)
+      assert_recognizes(options[:shallow_options].merge(:action =&gt; 'edit',    :id =&gt; '1'), :path =&gt; edit_member_path, :method =&gt; :get)
+      assert_recognizes(options[:shallow_options].merge(:action =&gt; 'update',  :id =&gt; '1'), :path =&gt; member_path,      :method =&gt; :put)
+      assert_recognizes(options[:shallow_options].merge(:action =&gt; 'destroy', :id =&gt; '1'), :path =&gt; member_path,      :method =&gt; :delete)
+
+      assert_recognizes(options[:options].merge(:action =&gt; 'index',  :format =&gt; 'xml'), :path =&gt; &quot;#{collection_path}.xml&quot;,   :method =&gt; :get)
+      assert_recognizes(options[:options].merge(:action =&gt; 'new',    :format =&gt; 'xml'), :path =&gt; &quot;#{new_path}.xml&quot;,          :method =&gt; :get)
+      assert_recognizes(options[:options].merge(:action =&gt; 'create', :format =&gt; 'xml'), :path =&gt; &quot;#{collection_path}.xml&quot;,   :method =&gt; :post)
+      assert_recognizes(options[:shallow_options].merge(:action =&gt; 'show',    :id =&gt; '1', :format =&gt; 'xml'), :path =&gt; &quot;#{member_path}.xml&quot;,       :method =&gt; :get)
+      assert_recognizes(options[:shallow_options].merge(:action =&gt; 'edit',    :id =&gt; '1', :format =&gt; 'xml'), :path =&gt; formatted_edit_member_path, :method =&gt; :get)
+      assert_recognizes(options[:shallow_options].merge(:action =&gt; 'update',  :id =&gt; '1', :format =&gt; 'xml'), :path =&gt; &quot;#{member_path}.xml&quot;,       :method =&gt; :put)
+      assert_recognizes(options[:shallow_options].merge(:action =&gt; 'destroy', :id =&gt; '1', :format =&gt; 'xml'), :path =&gt; &quot;#{member_path}.xml&quot;,       :method =&gt; :delete)
 
       yield options[:options] if block_given?
     end
@@ -798,14 +872,24 @@ class ResourcesTest &lt; Test::Unit::TestCase
       options[:options] ||= {}
       options[:options][:controller] = options[:controller] || controller_name.to_s
 
+      if options[:shallow]
+        options[:shallow_options] ||= {}
+        options[:shallow_options][:controller] = options[:options][:controller]
+      else
+        options[:shallow_options] = options[:options]
+      end
+
       @controller = &quot;#{options[:options][:controller].camelize}Controller&quot;.constantize.new
       @request    = ActionController::TestRequest.new
       @response   = ActionController::TestResponse.new
       get :index, options[:options]
       options[:options].delete :action
 
-      full_prefix = &quot;/#{options[:path_prefix]}#{options[:as] || controller_name}&quot;
+      path = &quot;#{options[:as] || controller_name}&quot;
+      shallow_path = &quot;/#{options[:path_prefix] unless options[:shallow]}#{path}&quot;
+      full_path = &quot;/#{options[:path_prefix]}#{path}&quot;
       name_prefix = options[:name_prefix]
+      shallow_prefix = &quot;#{options[:name_prefix] unless options[:shallow]}&quot;
 
       new_action  = &quot;new&quot;
       edit_action = &quot;edit&quot;
@@ -814,15 +898,15 @@ class ResourcesTest &lt; Test::Unit::TestCase
         edit_action = options[:path_names][:edit] || &quot;edit&quot;
       end
 
-      assert_named_route &quot;#{full_prefix}&quot;,            &quot;#{name_prefix}#{controller_name}_path&quot;,              options[:options]
-      assert_named_route &quot;#{full_prefix}.xml&quot;,        &quot;formatted_#{name_prefix}#{controller_name}_path&quot;,    options[:options].merge(            :format =&gt; 'xml')
-      assert_named_route &quot;#{full_prefix}/1&quot;,          &quot;#{name_prefix}#{singular_name}_path&quot;,                options[:options].merge(:id =&gt; '1')
-      assert_named_route &quot;#{full_prefix}/1.xml&quot;,      &quot;formatted_#{name_prefix}#{singular_name}_path&quot;,      options[:options].merge(:id =&gt; '1', :format =&gt; 'xml')
+      assert_named_route &quot;#{full_path}&quot;, &quot;#{name_prefix}#{controller_name}_path&quot;, options[:options]
+      assert_named_route &quot;#{full_path}.xml&quot;, &quot;formatted_#{name_prefix}#{controller_name}_path&quot;, options[:options].merge(:format =&gt; 'xml')
+      assert_named_route &quot;#{shallow_path}/1&quot;, &quot;#{shallow_prefix}#{singular_name}_path&quot;, options[:shallow_options].merge(:id =&gt; '1')
+      assert_named_route &quot;#{shallow_path}/1.xml&quot;, &quot;formatted_#{shallow_prefix}#{singular_name}_path&quot;, options[:shallow_options].merge(:id =&gt; '1', :format =&gt; 'xml')
 
-      assert_named_route &quot;#{full_prefix}/#{new_action}&quot;,        &quot;new_#{name_prefix}#{singular_name}_path&quot;,            options[:options]
-      assert_named_route &quot;#{full_prefix}/#{new_action}.xml&quot;,    &quot;formatted_new_#{name_prefix}#{singular_name}_path&quot;,  options[:options].merge(            :format =&gt; 'xml')
-      assert_named_route &quot;#{full_prefix}/1/#{edit_action}&quot;,     &quot;edit_#{name_prefix}#{singular_name}_path&quot;,           options[:options].merge(:id =&gt; '1')
-      assert_named_route &quot;#{full_prefix}/1/#{edit_action}.xml&quot;, &quot;formatted_edit_#{name_prefix}#{singular_name}_path&quot;, options[:options].merge(:id =&gt; '1', :format =&gt; 'xml')
+      assert_named_route &quot;#{full_path}/#{new_action}&quot;, &quot;new_#{name_prefix}#{singular_name}_path&quot;, options[:options]
+      assert_named_route &quot;#{full_path}/#{new_action}.xml&quot;, &quot;formatted_new_#{name_prefix}#{singular_name}_path&quot;, options[:options].merge(:format =&gt; 'xml')
+      assert_named_route &quot;#{shallow_path}/1/#{edit_action}&quot;, &quot;edit_#{shallow_prefix}#{singular_name}_path&quot;, options[:shallow_options].merge(:id =&gt; '1')
+      assert_named_route &quot;#{shallow_path}/1/#{edit_action}.xml&quot;, &quot;formatted_edit_#{shallow_prefix}#{singular_name}_path&quot;, options[:shallow_options].merge(:id =&gt; '1', :format =&gt; 'xml')
 
       yield options[:options] if block_given?
     end</diff>
      <filename>actionpack/test/controller/resources_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>be4ae1f5264d6593e9dec479af4503c4bde2877e</id>
    </parent>
  </parents>
  <author>
    <name>Pratik Naik</name>
    <login>lifo</login>
    <email>pratiknaik@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/83c6ba18899a9f797d79726ca0078bdf618ec3d4</url>
  <id>83c6ba18899a9f797d79726ca0078bdf618ec3d4</id>
  <committed-date>2008-08-30T07:20:20-07:00</committed-date>
  <authored-date>2008-08-30T06:58:16-07:00</authored-date>
  <message>Add support for shallow nesting of routes. [#838 state:resolved]

Adds :shallow option to resource route definition. If true, paths for nested
resources which reference a specific member (ie. those with an :id parameter)
will not use the parent path prefix or name prefix.

Example :

map.resources :users, :shallow =&gt; true do |user|
  user.resources :posts
end

* GET /users/1/posts (maps to PostsController#index action as usual)
  named route &quot;user_posts&quot; is added as usual.

* GET /posts/2 (maps to PostsController#show action as if it were not nested)
  Additionally, named route &quot;post&quot; is added too.</message>
  <tree>6a5d99003c58f1eda9477e0ffee197227705f09a</tree>
  <committer>
    <name>Pratik Naik</name>
    <login>lifo</login>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
