What's the best way to include a WebGL project in a Rails app (using Rails' asset pipeline, etc)
Hey all,
I've got a relatively small Unity game, and I'm trying to export it using WebGL so it can be included in our Rails app... that said, I have no idea where to place the files or what to do with them so that they will be picked up properly. Through stabbing in the dark, I've been able to get the data/code/memUrl values to point at the files (or at least stop erroring at me), but I had to add 'gz' to the file extensions to get them picked up, so I don't know if that broke anything.
As it stands right now, I'm getting 404s for all of the loading / progress bar assets, and some JS errors like this:
optimizing out Math.fround calls
Invoking error handler due to
Uncaught SyntaxError: Unexpected identifier
blob:http%3A//localhost%3A3000/2780f0a5-af74-463d-92de-ce876dca3666:1 Uncaught SyntaxError: Unexpected identifier
Does anyone have a line on a tutorial that walks through how to include WebGL output in a Rails app? Any help would be greatly appreciated.
Answer by Thaewyn · Jun 02, 2016 at 09:30 PM
Okay, managed to make it work. There are still some hiccups, but the main thing is just getting the asset files into the right location and loading them properly with rails helper methods ("asset_path" and "javascript_include_tag" and the like), which I am much less familiar with. It's not without issues, but it at least runs for now.
Your answer
![](https://koobas.hobune.stream/wayback/20220612082110im_/https://answers.unity.com/themes/thub/images/avi.jpg)