This problem is a little pain in the ass, as it took me a couple of hours to get more understanding of it. The problem was not that their aren't many posts talking about the problem and offering many solutions, but none worked for me. I found useful this post, and this one. Go through these posts if you still don't know what the problem is about.
The solution that worked for me:
before_filter :set_charset
def set_charset
str_type = request.xhr? ? 'javascript' : 'html'
headers['Content-Type'] = "text/#{str_type}; charset=ISO-8859-1"
end