index.js.haml未加载

I am using inherited_resources and in my controller I specified respond_to :js, :only => [:index].

But when I trigger an oncange event for dropdown a ajax url that hits the controller index method with appropriate queries.

I am trying to refresh the div using index.js.haml. But it was not loading.

In my rails log

I am getting Processing by MessagesController#index as */*

Why I didn't get this with 'js' format instead of */*. Where I am doing wrong? How to get this to work?

" */ * "means that the "browser" accepts anything you will send back , It basically depends on HTTP_ACCEPT send by browsers.

see https://stackoverflow.com/a/3793974/1970061 for more details.

Your div is not refreshing because your JavaScript in response Text is not executing. Use Jquery eval() function to Run javascript of response text