All threads / How do I embed an internal routes/show page on to an external website?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I embed an internal routes/show page on to an external website?

Arjun Rajkumar asked in Javascript
Hey all, 

I've seen websites where you place some Javascript code - and they are able to display information from another website on their website. Wondering how I can do the same? I have a www.xyz.com/maps/id/show page which displays a map of a user with some other details. Any idea how I can embed this same page on an external website www.abc.com/map which shows the same map?

Thanks.

Arjun

Since most of it is done using Javascript, you could technically copy the code from any example you have. 
As for the Rails part, you likely need to get `get` the Json for the user. Also CORS is something to keep in mind. 
I've build a couple of JS snippets/embeds. Happy to help with any specific issues.
Thanks will try over the weekend and get back if any doubts. 
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 34,674+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.