Newbie :: Running script at client side

Hi all,
I am newbie to Ruby and web programming as well.
My show.rhtml is like,
.


<% require ‘win32ole’ %>
<% ie = WIN32OLE.new(‘InternetExplorer.Application’) %>
<% ie.visible = true %>
<% ie.gohome %>


.

At server, when I access http://…/show it’ll open Iexplorer.exe as
expected,
but when I access same from different m/c it opens Iexplorer.exe at
server only,
obviously. How can open it on client side?
Please help me out.
Thanks

Rahul Ha wrote:

Hi all,
I am newbie to Ruby and web programming as well.
My show.rhtml is like,
.


<% require ‘win32ole’ %>
<% ie = WIN32OLE.new(‘InternetExplorer.Application’) %>
<% ie.visible = true %>
<% ie.gohome %>


.

At server, when I access http://…/show it’ll open Iexplorer.exe as
expected,
but when I access same from different m/c it opens Iexplorer.exe at
server only,
obviously. How can open it on client side?
Please help me out.
Thanks

No Way.
First, Browsers don’t allow the servers to execute code outside of their
of their own application (security reasons). This is especially true for
starting other applications.

Consider this:

<% ´format d:´ %> :wink:

Second, chances are high that the client does not have ruby installed…
:wink:

Third, rhtml templates parse every bit of ruby inside your template, so
it will only be executed on your side.

Thanks,
So, you want say that, if I want to open a PDF file stored on server, I
need to download it first, and then open.
How can open a PDF/Document in browser from client m/c?
Regards,

No Way.
First, Browsers don’t allow the servers to execute code outside of their
of their own application (security reasons). This is especially true for
starting other applications.

Consider this:

<% ´format d:´ %> :wink:

Second, chances are high that the client does not have ruby installed…
:wink:

Third, rhtml templates parse every bit of ruby inside your template, so
it will only be executed on your side.

And, besides the obvious security problems involved in that, you would
be making your web based application platform specific. That’s never
a good thing.

On Apr 16, 6:50 am, Florian G. [email protected]

How can open a PDF/Document in browser from client m/c?
Regards,

try opening the pdf file as binary data and send it with the
‘send_data’ function to the browser.
http://railsapi.org/send_data

something like that should do the trick:

mime_type = ‘application/pdf’
filename = ‘filename’
extension = ‘pdf’
send_data(function_to_get_the_pdf_as_binary, :filename =>
“#{filename}.#{extension}”, :type => mime_type, :disposition =>
‘inline’)

calling this function should send the pdf to the browser. than you
have a sercer side stored pdf opened on client.
don’t know if there’s a better way. never used server stored pdf’s
with RoR. so perhaps somebody else can tell you a better way.

regards