0

I need to take the user input from an HTML form and send that data to a Ruby script (not rails). Is there any way to do this? I've read some documentation on potentially doing so with PHP but I'm still unfamiliar on how I'd pass the inputs from PHP to the Ruby script. I know how to call the script from PHP, but am still uncertain on passing the input information. Any adivce?

Kendra
  • 21
  • 4
  • Don't mix languages like this if you can avoid it.... Does that script really need to be in ruby (how hard would it be to rewrite in PHP)? Does your web page really need to be in PHP (how hard would it be to knock something up in ruby)? – Tom Lord May 31 '17 at 15:43
  • Can you be more specific about which part you're uncertain about? Do you know how to get input from a form with PHP? – Don't Panic May 31 '17 at 15:43
  • What server are you using? See here: https://github.com/7stud/ruby_cgi/blob/master/README.md – 7stud May 31 '17 at 18:44
  • id you are using rails and dont want to have model you can have a custom class that defines the object to handle the data from the form, check the railscast on contact forms, you can apply the same concept and use your script there. Now if you want to do this with pure ruby, you should pick all the gem necessary to get a server up and running and handle the http requests, but that would be a lot more complicated – Alexis May 31 '17 at 20:42

0 Answers0