Well, this answer is a few years late, but you can also create your layout as a html-specific layout by renaming it to apps/views/layouts/application.html.erb
.
If the mime-type doesn't match up, Rails is smart enough not to use the layout for js responses.
It's very possible that more recent versions of rails take care of this for you, but this works for me as of 3.0.20.