I have a ruby file on my server (a simple test file). I am wondering how I can use javascript to execute that file on server with a button click. Nothing fancy I want here like rails or asp or php. Its just a small test and I want to see how far it goes. On terminal, all I have to do is ruby test.rb. Is there a way to do this with javascript on an html page?
I have a ruby file on my server (a simple test file). I am
Share
Adapt the script so your webserver can access it with a Rack or CGI.
Then you just need to make an HTTP request to it. You could set
location = URI, callsubmit()on a form, useXMLHttpRequestor any of a host of other options.