1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix bug where nested resources ignore a parent singleton parent's path prefix. Closes #6940 [Dan Kubb]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Rick Olson 2007-01-08 01:07:48 +00:00
parent 31fb0deec1
commit 0727af86fc
3 changed files with 16 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Fix bug where nested resources ignore a parent singleton parent's path prefix. Closes #6940 [Dan Kubb]
* Fix no method error with error_messages_on. Closes #6935 [nik.wakelin Koz]
* Slight doc tweak to the ActionView::Helpers::PrototypeHelper#replace docs. Closes #6922 [Steven Bristol]

View file

@ -307,7 +307,7 @@ module ActionController
map_member_actions(map, resource)
if block_given?
with_options(:path_prefix => resource.singular, &block)
with_options(:path_prefix => resource.nesting_path_prefix, &block)
end
end
end

View file

@ -247,6 +247,19 @@ class ResourcesTest < Test::Unit::TestCase
assert_simply_restful_for :messages, :path_prefix => 'account/'
end
end
def test_should_nest_resources_in_singleton_resource_with_path_prefix
with_routing do |set|
set.draw do |map|
map.resource(:account, :path_prefix => ':site_id') do |account|
account.resources :messages
end
end
assert_singleton_restful_for :account, :path_prefix => '7/', :options => { :site_id => '7' }
assert_simply_restful_for :messages, :path_prefix => '7/account/', :options => { :site_id => '7' }
end
end
def test_should_nest_singleton_resource_in_resources
with_routing do |set|