Basically I want to store a Ruby Block into DB and use them.
One could ask why – reason being, i want my users to be able to post / upload a block code – which could be executed to fetch a desired result for their problem on the data we might have.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So you don’t want to store ruby blocks. You want to store code. This is easier. Just store the code as a string. And then later you can
evalthat string, effectively executing the code.Now you have to solve a hard problem: how to prevent users from posting malicious code (or how to sandbox them). But that’s out of scope here.