implements the "right way" of ajax call in rails