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 -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. > ThanksNo 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:´ %> ;) Second, chances are high that the client does not have ruby installed... ;) Third, rhtml templates parse every bit of ruby inside your template, so it will only be executed on your side. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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:´ %> ;) > > Second, chances are high that the client does not have ruby installed... > ;) > > Third, rhtml templates parse every bit of ruby inside your template, so > it will only be executed on your side.-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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 --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Gilcher <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 accesshttp://.../showit''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:´ %> ;) > > Second, chances are high that the client does not have ruby installed... > ;) > > Third, rhtml templates parse every bit of ruby inside your template, so > it will only be executed on your side. > > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---