The code itself would be in ruby. Idea is to make it interactive for user. For instance, code asks:
what is your name?
user input “John”
Hi John!
I know I can make it <%…%>. I want to make it in a separate ruby.rb file that would be “uploaded” via form in new template. In show template results of code would be displayed. Any gem for this sort of interactivity?
Looking forward
Thanks
This is incredibly bad practice, and should never be used without sanitizing input, but Ruby has an
evalstatement. Pass it a string (such as a param POSTed by your form), and it’ll evaluate that string as Ruby and return the result.If you’re expecting a .rb file to be uploaded, you can read that file and pass the contents to
eval.But remember, treat all input as hostile.