Does it dump the entire output of the script in there? Is there a
reason why you couldn''t just write a five or six line helper function
that uses Net::HTTP to grab the output and then just return it.
Something like:
in your application helper:
require ''net/http''
require ''uri''
def http_include(uri_str)
response = Net::HTTP.get_response(URI.parse(uri_str))
if response == Net::HTTPSuccess
return response.body
return "Error Message or handle error here..."
end
and in your template:
<%=http_include ''http://whatever.com/url"%>
This could of course be made much more robust, handle redirection,
etc. See the net/http docs for details.
If there''s already something like this, then I apologize for the
noise. I don''t remember it, but then again I haven''t been
heavily
hacking rails since the 0.9 days.
Brian
On 4/18/05, Glenn Smith
<glenn.rails-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Still trying to figure out if I can include the results of a JSP call
> in a rails .RHTML file.
>
> JSP seems to have <jsp:include> which, going by this:
>
> http://www.onjava.com/pub/a/onjava/excerpt/java_cookbook_ch18/?page=8
>
> suggests that "The <jsp:include> can include a URL of any type
(HTML,
> servlet, JSP, CGI, even PHP or ASP)".
>
> Which is exactly what I want. Except I want to do it the other way
> round - .JSP included into a .RHTML file.
>
> Discussed this on the IRC last night a little but no solid answer - any
ideas?
>
> Glenn
> aka spindle
> Aylesbury, UK
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
The years ahead pick up their dark bags.
They move closer. There''s a slight rise in the silence
then nothing.
--
(If you''re receiving this in response to mail sent to
bluczkie-OM76b2Iv3yLQjUSlxSEPGw@public.gmane.org, don''t be concerned
This is my new address,
but mail will be forwarded here indefinitely)