I currently have a rails app serving up JSON, and a separate app created with phoneJS consuming that JSON. I'd like to be able to integrate the phoneJS code directly into my rails app, but am unsure how. The folder structure for phoneJS is very different to the assets folder in rails. I ideally would like to find an example app where the two are combined, but have been unable to.
How to incorporate phoneJS code into rails app?
123 views Asked by user3084808 At
1
I can suggest you to put all phonejs sources to /public folder in your rails application.
For example, I created 'assets' folder into /public and put there my phonejs application.
Next, I made simple home_controller.rb which can return some JSON data.
For retrieving data I was using the following code inside /public/assets/phonejs/views/home.js file:
You can see phonejs app at this URL: localhost:3000/assets/phonejs/index.html
Also, you can try to put phonejs sources to vendor/assets or lib/assets or app/assets folder.
Source.zip - source code of my app (ruby 2.0, rails 4).