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('#','');
}
精彩评论