Andrew Knott
2006-Aug-02 11:18 UTC
[Rails] Does Ruby / Rails have something similar to PHPs ''virtual''
Hi all Is there a rails / ruby function that is analagous to PHPs ''virtual'' function? "virtual() is an Apache-specific function which is similar to <!--#include virtual...--> in mod_include. It performs an Apache sub-request. It is useful for including CGI scripts or .shtml files, or anything else that you would parse through Apache. Note that for a CGI script, the script must generate valid CGI headers. At the minimum that means it must generate a Content-type header." Details: http://uk.php.net/manual/en/function.virtual.php Andrew -- Posted via http://www.ruby-forum.com/.
Eaden McKee
2006-Aug-02 11:26 UTC
[Rails] Does Ruby / Rails have something similar to PHPs ''virtual''
Hi there,>From that page:"This function is only supported when PHP is installed as an Apache module." Maybe mod_ruby has a similar function, but rails doesn''t support mod_ruby. Best Regards Eaden McKee On 8/2/06, Andrew Knott <aknott@mac.com> wrote:> Hi all > > Is there a rails / ruby function that is analagous to PHPs ''virtual'' > function? > > "virtual() is an Apache-specific function which is similar to > <!--#include virtual...--> in mod_include. It performs an Apache > sub-request. It is useful for including CGI scripts or .shtml files, or > anything else that you would parse through Apache. Note that for a CGI > script, the script must generate valid CGI headers. At the minimum that > means it must generate a Content-type header." > > Details: > > http://uk.php.net/manual/en/function.virtual.php > > > Andrew > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Alex Wayne
2006-Aug-02 20:23 UTC
[Rails] Re: Does Ruby / Rails have something similar to PHPs ''virtua
Andrew Knott wrote:> Hi all > > Is there a rails / ruby function that is analagous to PHPs ''virtual'' > function? > > "virtual() is an Apache-specific function which is similar to > <!--#include virtual...--> in mod_include. It performs an Apache > sub-request. It is useful for including CGI scripts or .shtml files, or > anything else that you would parse through Apache. Note that for a CGI > script, the script must generate valid CGI headers. At the minimum that > means it must generate a Content-type header." > > Details: > > http://uk.php.net/manual/en/function.virtual.php > > > AndrewRails doesn''t have a facility to communicate directly with apache like that, however it is very easy to download some html from a url: include ''open-uri'' data = open(''http://yahoo.com'') more_data = open(''http://localhost/cgi/somescript.cgi'') Check out more here: http://www.ruby-doc.org/stdlib/libdoc/open-uri/rdoc/ -- Posted via http://www.ruby-forum.com/.
Alex Wayne
2006-Aug-02 20:24 UTC
[Rails] Re: Does Ruby / Rails have something similar to PHPs ''virtua
That should have been: include ''open-uri'' data = open(''http://yahoo.com'').read more_data = open(''http://localhost/cgi/somescript.cgi'').read -- Posted via http://www.ruby-forum.com/.