Rails Ajax获取请求

I am trying to make a Ajax get request to display a text file which is located in my public folder. The function is as follows;

var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {
    XMLHttpRequestObject = new XMLHttpRequest();

} else if (window.ActiveXObject) {
    XMLHttpRequestObject =
    new ActiveXObject("Microsoft.XMLHTTP");
}

function getData(datasource, divID) {
    if (XMLHttpRequestObject) {
        var obj = document.getElementById(divID);
        XMLHttpRequestObject.open("GET", datasource, true);
        XMLHttpRequestObject.onreadystatechange = function() {
            if (XMLHttpRequestObject.readyState == 4 
                && XMLHttpRequestObject.status == 200) {
                obj.innerHTML = XMLHttpRequestObject.responseText;
            }
        }

        XMLHttpRequestObject.send(null);
    } 
}

Calling the actual function then;

<form>
    <input type="button" value="Display Message" onclick="getData('AjaxGreek.txt', 'targetDiv')">
</form>

The error I am getting is "no route matches [get] "pages/AjaxGreek.txt"

Pages is the controller.

I understand the error in as much as the browser is looking for the page pages/AjaxGreek which doesn't exist, as it's the text file I am trying to display.

Any help would be much appreciated.