2012/6/5 Mr. Puneet Kishor <punk.kish@gmail.com>:
In my code, I have put the following
get '/resource.:format' { return redirect '/gmna/resource.:format'; }; get '/gmna/resource.:format' => { .. };
But the above fails. One, the redirect doesn't seem to recognize and carry the .:format through (if I call resource.json, the program complains that '/gmna/resource.:format' wasn't found).
AFAIU, redirect needs path or url, it does not work with tokens, you need to give param or variable, like: get '/resource.:format' { return redirect '/gmna/resource.' . param('format'); };
Second, it doesn't prefix the /app/d/geomaps part to the redirected URI.
Some threads back it was asked also. Return can't originate from your prefix, because then is not possible to redirect to non-prefixed paths. Solution is to write your own wrapper like redirect_with_prefix. -- Wbr, Kõike hääd, Gunnar