{"issue":{"milestone":null,"user":{"id":180603,"login":"metakeule","url":"https://api.github.com/users/metakeule","avatar_url":"https://secure.gravatar.com/avatar/0dd2212a18f9aba8d63b14c552027a12?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"0dd2212a18f9aba8d63b14c552027a12"},"created_at":"2011-12-17T00:34:51Z","title":"Sinatra::Namespace does not prefix redirects","updated_at":"2011-12-17T01:17:20Z","labels":[],"state":"open","id":2586675,"html_url":"https://github.com/sinatra/sinatra-contrib/issues/27","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"I would expect the redirects to be prefixed like the routes.\r\n\r\n    namespace '/admin' do\r\n        get '/a' do\r\n            redirect '/b'  # is not redirecting to '/admin/b' but to '/b'\r\n        end\r\n\r\n        get '/a' do\r\n            redirect to('/b')  # is not redirecting to '/admin/b' but to '/b'\r\n        end\r\n     end\r\n\r\n:prefixed_redirects raises an error\r\n\r\n    namespace '/admin' do\r\n        enable :prefixed_redirects\r\n        get '/somewhere'\r\n     end\r\n\r\n     # => may not set prefixed_redirects (ArgumentError)\r\n\r\n\r\nI don't know where this should be fixed\r\n\r\n    module Sinatra::Namespace::NamespacedMethods\r\n        prefixed :to\r\n    end\r\n\r\ndidn't help either.","number":27,"url":"https://api.github.com/repos/sinatra/sinatra-contrib/issues/27","comments":2,"assignee":null},"comment":{"user":{"id":180603,"login":"metakeule","url":"https://api.github.com/users/metakeule","avatar_url":"https://secure.gravatar.com/avatar/0dd2212a18f9aba8d63b14c552027a12?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"0dd2212a18f9aba8d63b14c552027a12"},"created_at":"2011-12-17T01:17:20Z","updated_at":"2011-12-17T01:17:20Z","id":3186876,"body":"same thing for url()\r\n\r\n    module Sinatra::Namespace::InstanceMethods\r\n      def url(uri, *args)\r\n        prefix = @namespace.instance_variable_get(\"@pattern\")\r\n        super(\"#{prefix}#{uri}\", *args)\r\n      end\r\n    end\r\n","url":"https://api.github.com/repos/sinatra/sinatra-contrib/issues/comments/3186876"},"action":"created"}