Today I realized that the rails command redirect_to :back does not work in Internet Explorer because redirect_to :back depends on the HTTP_REFERER http header, which IE does not send. I was capturing an onclick event with jQuery and was able to sending along the current URL as a query string, which provided an easy way around this limitation.
In the view:
<script>
$jQuery('#myLink').click(function(){
window.location.href = 'theDestinationPage/?current_url=' + document.location ;
})
</script>
In the controller:
def myAction
.....
redirect_to params[:current_url]
end
One Comment
Cool! It did help me. thanks! :D