Is there any process in rails that i can initialize a remote site web page on my local app page. I want to fetch a remote web page like google home page https://www.google.com through <% render "https://www.google.co.in" %>
This is a requirement only because when ever i render a page in another controller so i faced error and i tried to solve it much more but now due to time i should prefer this
Asked
Active
Viewed 149 times
-1

DLeh
- 23,806
- 16
- 84
- 128

Prashant Ravi Darshan
- 535
- 2
- 12
-
Surround code snippets in ticks (`) to make them more distinct in your question – DLeh Mar 05 '15 at 19:19
1 Answers
0
The only way to have a remote site web page on your local app is using the <iframe></iframe>
tag. Using 'render' will not work. You can checkout the documentation here.
In your case that would be: <iframe src="http://www.example.com"></iframe>
Keep in mind that you cannot use www.google.co.in because Google's security policies block you from doing so (some other websites do this too but not many). Please see this question to see why you can't use google in an iframe.
Hope that helps!

Community
- 1
- 1

Danny López
- 126
- 5
-
Also, you can't use facebook in an iframe. Why are you trying to load facebook inside your webpage? – Danny López Mar 04 '15 at 21:22
-
I really do not have a need to load google and facebook in iframe. the question was a sample of talking about how to load a remote path through render. i respect to polices of fb and google but i want to load my own web page. But I already tried to add iframe before to ask the question but still there is some issue regarding content length and responsive in some of situation of layout. In the same the minor requirement of use of loading fb like i want to load whole community page on my site but for this i will use fb developer section. Thank You so much for you answer. – Prashant Ravi Darshan Mar 05 '15 at 07:05
-
Is it confirmed from rails development community that we can not use http://example.com as a reference in render – Prashant Ravi Darshan Mar 05 '15 at 07:08
-
You can render a lot of things using rails render. This can be actions, partials, templates, files, text, streaming data, xml, json, js, etc. But unfortunately you cannot render outside urls such as example.com. Please see [documentation](http://apidock.com/rails/ActionController/Base/render) for more info – Danny López Mar 11 '15 at 21:14