Sometimes I’ll need to redirect the page, like for authentication or handling my wallpost click-thrus. In PHP I would echo out some Javascript that would set the top.location.href to where I wanted it to go. Is there a way in Rails that will allow me to use the redirect_to or should I just do it using Javascript? I’ve tried doing stuff like redirect_to “http://apps.facebook.com/my_app_name” in the controller but it just hangs on a white page.
Sometimes I’ll need to redirect the page, like for authentication or handling my wallpost
Share
redirect_to sets the HTTP headers (I believe) to have the browser redirect. When using an iframe app, the headers have already been sent and the HTML loaded (to load the iframe, to begin with), so it’s not possible to change the current URL through those headers. Instead, you have to do it with your JS suggestion, using
or something similar.