Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Created June 23, 2012 05:03
Show Gist options
  • Save jondkinney/2976956 to your computer and use it in GitHub Desktop.
Save jondkinney/2976956 to your computer and use it in GitHub Desktop.
Break out of an iFrame from a controller in Rails and redirect to a relative path
render :text => "<html><body><script type='text/javascript' charset='utf-8'>parent.location.href = '/somewhere';</script></body></html>"
@Dreamjer
Copy link

Dreamjer commented Jan 5, 2016

Hi,
It works fine for me with Firefox and Safari but not for Chrome, IE and Opera.
:(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment