still not working in rails for some reason, trying this instead