routing - Embed external website in Rails template -


i have rails site , externally hosted wordpress blog. want able send users mysite.com/blog , have them hit blog. can pretty redirect. no longer on main site.

what want render blog inside main template, navbar site remains on page, , url stays mysite.com/blog. ideally, when clicked on link in blog, render inside template, navbar , url rails site remain intact.

is possible?

there few ways this. examples:

  1. iframes come mind first. frowned upon in modern web development, see this question lots of reasons, simplest way.
  2. jquery .load(), or basic ajax call. note because of same origin policy, won't work if you're trying retrieve domain. workaround include in wordpress site explicitly allow requests rails site: <customheaders> <add name="access-control-allow-origin" value="http://your-rails-site.com" /> </customheaders>
  3. html imports

there other ways including not limited <object> , <embed> tags. suggest research them , find best solution use case.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -