From 5c87e9adddc22703a3dbbb785e32fafe0e91ce78 Mon Sep 17 00:00:00 2001 From: Tom Stuart Date: Sat, 7 Mar 2009 22:50:58 +0000 Subject: Ensure shallow routes respects namespace [#1356 state:resolved] Signed-off-by: Pratik Naik --- actionpack/lib/action_controller/resources.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index 8195b38685..0a89c4b3d5 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -91,7 +91,7 @@ module ActionController end def shallow_path_prefix - @shallow_path_prefix ||= "#{path_prefix unless @options[:shallow]}" + @shallow_path_prefix ||= @options[:shallow] ? @options[:namespace].try(:sub, /\/$/, '') : path_prefix end def member_path @@ -103,7 +103,7 @@ module ActionController end def shallow_name_prefix - @shallow_name_prefix ||= "#{name_prefix unless @options[:shallow]}" + @shallow_name_prefix ||= @options[:shallow] ? @options[:namespace].try(:gsub, /\//, '_') : name_prefix end def nesting_name_prefix -- cgit v1.2.3