finally fixed the angular  problems by properly rendering the json in the rails controllers.