Mauricio Szabo wrote:
> But if you require 'open-uri':
>
>>> require 'open-uri'
> => true
>>> open("http://example.com/").read
> => "<HTML>\r\n<HEAD>\r\n <TITLE>Example Web Page</TITLE>\r\n</HEAD> \r
> \n<body> \r\n<p>You have reached this web page by
> typing"example.com",\r\n"example.net",\r\n or
> "example.org" into your web browser.</p>\r\n<p>These domain
> names are reserved for use in documentation and are not available \r
> \n for registration. See <a href="http://www.rfc-editor.org/rfc/
> rfc2606.txt">RFC \r\n 2606</a>, Section 3.</p>\r\n</BODY>\r\n</HTML>\r
> \n\r\n"
Wow! This is a bad idea. Including a full page inside another page just
makes my skin crawl. If I absolutely had to do something like this I
would maybe grab the page using open(...), but then strip out only the
contents inside the body tag and render that inside the final page.
Otherwise you'll never be able to get a clean validation anything using
that "navbar page."
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---