Why are you doing this? We should serve only static JS, which is compiled using the asset pipeline, and handles data read as json.