开发者

Parsing Ruby on Rails Parameters (with a # instead of a ?)

I have an application that I am building and the user eveuntually gets redirected to a url on my application like this www.myapp.com/path/#access_token=lkjh8usoij93. How can I parse the access token using ruby on rails? It does not show u开发者_开发知识库p as a supplied parameter.


You can't get anchors with Rails (on server side). You can get it only with javascript window.location.href


Use JavaScript to get access_token.

if (window.location.hash) {
    access_token = window.location.hash.replace('#','');
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜