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

Reply
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.
Reply
Thanks will try over the weekend and get back if any doubts. 
Reply
Join the discussion
Create an account Log in

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

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

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

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.