mercredi 30 décembre 2020

run ruby file from ajax or on button click event

i am new in ruby. so i have html code which includes one input field and button and i want when user click on that button i have to run one ruby file which has system() method.

index.html


     <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
     </head>
     <body>
        <form method="post" action="/runMethod">
           <input type="text" name="name" value="whatever">
           <input class='btn btn-primary' type='submit' value='click'>
        </form>
     </body>

   

app.rb

 system("wayback_machine_downloader userInput")

this is my two files code. i just want that if i click on button app.rb file should run with given input. is it possible?

Aucun commentaire:

Enregistrer un commentaire