namespace problem with RequestPathIntrospection
Reported by Ian White | September 29th, 2009 @ 08:33 AM
[submitted on behalf of Sergei Serdyuk]
RequestPathIntrospection#remove_namespace behaves incorrectly by
stripping the front forward slash if controller_path !=
controller_name but namespace_segments is empty. Because of the
lost slash #segments_for_path_and_keys would later chop of the
first character of the first path segment. I added an additional
check as following:
def remove_namespace(path)
(controller_path != controller_name) && !namespace_segments.empty? ? path.sub(%r(^/#{namespace_segments.join('/')}), '') : path
end
Comments and changes to this ticket
-
Ian White September 29th, 2009 @ 08:47 AM
- State changed from new to resolved
(from [bd88902d4f848fda346ad3ad2af1336fc62bbfdd]) Make sure 1st character not chopped by empty namespace segments [#6 state:resolved] http://github.com/ianwhite/resources_controller/commit/bd88902d4f84...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
resources_controller is a rails plugin that eases the pain of RESTful controllers.
People watching this ticket
Referenced by
- 6 namespace problem with RequestPathIntrospection (from [bd88902d4f848fda346ad3ad2af1336fc62bbfdd]) Make su...