views:

29

answers:

0

I have a comments controller with index and create actions among others. Both those actions respond to html and js format.

Whenever I got create request via ajax, I would like to add new comment and then redirect to index.js, so the comments on screen are updated without reloading the page.

This sort of thing works flawlesly in Chrome. But whenever I try this in Firefox or IE, it turns out, that the redirect from create.js lands in index.html...

Even when i force the redirect to be js:

redirect_to polymorphic_path([@commentable, :comments]), :format => 'js'

It land up in the format.html in Firefox and IE.

Any idea what might be happening here?