How to unescape rails redirect_to's :anchor => "/ui-tabs-1"
What I want is
redirect_to ... :anchor => "/ui-tabs-1" #=> http://....#/ui-tabs-1
What I get is
redirect_to ... :anchor => "/ui-tabs-1" #=> http://....#%2Fui-tabs-1
I want 开发者_StackOverflow社区to include the forward slash in my redirect_to (unescaped).
Thanks
I assume you want to include the forward slash in your redirect to Url?
If yes, you can just unescape it
require 'cgi'
redirect_to CGI::unescape(create_path_here_with_anchor)
else removing the forward slash from anchor makes it work
anchor => "ui-tabs-1"
Try using single quotes
redirect_to ... :anchor => '/ui-tabs-1'
精彩评论