Ratnavel Sundaramurthi
2008-May-03 11:42 UTC
Can i call a .php or .aspx files from rhtml page?
I have some code written in php and that is placed in my public folder with .php extension. Is there a way to call that file? Thanks, Ratnavel. -- 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 -~----------~----~----~----~------~----~------~--~---
Rails Terrorist
2008-May-03 13:44 UTC
Re: Can i call a .php or .aspx files from rhtml page?
Ratnavel Sundaramurthi wrote:> I have some code written in php and that is placed in my public folder > with .php extension. > > Is there a way to call that file? > > Thanks, > Ratnavel.[1] Open app/helpers/application_helper.rb [2] paste it under module ApplicationHelper def link_to_file(name, file, *args) if file[0] != ?/ file = "#{@request.relative_url_root}/#{file}" end link_to name, file, *args end [3] In your view, put it: <%= link_to_file "teapoci file here", "teapoci.php" %> Enjoy, http://teapoci.blogspot.com Reinhart -- 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 -~----------~----~----~----~------~----~------~--~---
you could download the file and then print outs its results On Sat, May 3, 2008 at 7:44 AM, Rails Terrorist <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Ratnavel Sundaramurthi wrote: > > I have some code written in php and that is placed in my public folder > > with .php extension. > > > > Is there a way to call that file? > > > > Thanks, > > Ratnavel. > > > > [1] Open app/helpers/application_helper.rb > [2] paste it under module ApplicationHelper > > def link_to_file(name, file, *args) > if file[0] != ?/ > file = "#{@request.relative_url_root}/#{file}" > end > link_to name, file, *args > end > > [3] In your view, put it: > > <%= link_to_file "teapoci file here", "teapoci.php" %> > > > > Enjoy, > http://teapoci.blogspot.com > Reinhart > > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-05 09:46 UTC
Re: Can i call a .php or .aspx files from rhtml page?
On 3 May 2008, at 12:42, Ratnavel Sundaramurthi wrote:> > I have some code written in php and that is placed in my public folder > with .php extension. > > Is there a way to call that file?Do you just want the user to be able the view the result of executing that page (in which case it''s probably just a matter of setting up apache etc... properly) or do you want to execute the php code yourself and do something with the results yourself (in which case the easiest way may be to just run the file through the php executable). Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---