--- resources_controller.rb +++ (clipboard) @@ -735,7 +735,7 @@ end rescue MissingSegment # fallback: construct enclosing names from param ids - @route_enclosing_names = params.keys.select{|k| k.to_s =~ /_id$/}.map{|id| [id.sub('_id','').pluralize, false]} + @route_enclosing_names = (recognized_route and recognized_route.significant_keys or params).select{|k| k.to_s =~ /_id$/}.map{|id| [id.to_s.sub('_id','').pluralize, false]} end # this is the before_filter that loads all specified and wildcard resources