def method_name
#some RUBY code
respond_to do |format|
format.js {#render some JSON}
format.html {#redirect to somewhere}
end
end
Now, everything seemed to be working good on FireFox and Chrome. Next was the turn of IE. As expected, MORE PROBLEMS.....!! It didn't work!!! It started showing File Download Security Warning Dialog. I had no clue what it was doing. I was totally stumped. Finally, after a bit of googling I came across this post. It saved my day.
As mentioned in the post, I tried printing the request.format for normal HTML request. To my surprise, IE was registering the Mime::Type to be "image/gif". Also, format.html? was nil.
I tried accessing the same action from FireFox. This time, the request format was set correctly to be "text/html".
Now, there is no Mime::Type registered for "image/gif". Hence, first accept type was taking preference. The solution (moving format.html before format.js) mentioned in the post worked for me.