开发者

Redirect to index#tab1

开发者 https://www.devze.com 2023-02-01 20:45 出处:网络
This must be simple, but how can i do a redirect to http://myURL/index#tab1 without having to specify a url ?

This must be simple, but how can i do a redirect to http://myURL/index#tab1 without having to specify a url ?

I tried something like :

redirect_to :action=> 'index#tab1'

But it thinks it's an action an开发者_开发知识库d does not work (because of the # symbol actually).

Any ideas ?


You should be able to do:

redirect_to :action => 'index', :anchor => "tab1"


Perhaps this:

redirect_to 'index#tab1'
0

精彩评论

暂无评论...
验证码 换一张
取 消