How do I make Javascript talk to my Rails app each on a different domain?

I have a basic rails CRUD app.

I have an idea and I want to take a chunk of front-end code (HTML, CSS, JS) and be able to put it on any page to make a form to talk to my Rails app doing CRUD commands.

I think this is possible by having my rails app return JSON to my front-end form (not sure how to do this on the rails end).

Sorry to be redundant by the idea is: JS is on and sends info to rails app on domain.2, rails then sends back info continue back and forth. I

Leave a Comment