Skip to content

Commit

Permalink
Make sure 1st character not chopped by empty namespace segments [#6 s…
Browse files Browse the repository at this point in the history
…tate:resolved]
  • Loading branch information
ianwhite committed Sep 29, 2009
1 parent 0376d10 commit bd88902
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ardes/resources_controller/request_path_introspection.rb
Expand Up @@ -34,7 +34,11 @@ def current_segment
end

def remove_namespace(path)
(controller_path != controller_name) ? path.sub(%r(^/#{namespace_segments.join('/')}), '') : path
if (controller_path != controller_name) && namespace_segments.any?
path.sub(%r(^/#{namespace_segments.join('/')}), '')
else
path
end
end

def segments_for_path_and_keys(path, keys)
Expand Down

0 comments on commit bd88902

Please sign in to comment.