开发者

Rails Delete Resource Identifier on Redirect

I have a proje开发者_StackOverflowct using jQuery Mobile (uses resource identifier heavily) with Facebook authentication. Recently Facebook started adding #_=_ to callbacks (see here). This is killing jQuery Mobile.

Is it possible to do an automatic redirect for any routes matching #_=_ to the stripped counterpart? Is it possible to specify a resource identifier (#) when doing a redirect to? Any other possible fixes? I currently use a javascript redirect but this causes duplicate page loads and issues with some of the analytics.


Added in the following work around until Facebook fixes it (seems to work):

# app/controllers/omniauth_controller.rb

def create
  ...
  js_redirect_to(user_path)
end

private

def js_redirect_to(path)
  @location = path
  render "shared/redirect"
end

# app/views/shared/redirect.html.haml

:javascript
  window.location = '#{@location}'
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜