Plain english to condition??

V

Varun Goel

Hi All,
I wanna to do something like as:
1. Use will type plain English in text box like designation equals PM or
designation = PM.

2.Then i have to save this rule in DB and i have to made some function
to verify this rule.

3. My problem is that how to make if condition for following rule
dynamically.Cos in ROR i can say designation == 'PM'then fine but how i
will check that designation equals PM.

4.Means i have to make condition from plain english dynamically.

Please tell me ur suggestions.

Thanks
Varun
 
D

Daniel Finnie

[Note: parts of this message were removed to make it a legal post.]

Why not have one input box on the right and one on the left with an equals
sign in the middle. Then you can so something like this:

left_box = "designation"
right_box = "PM"

model_instance.send(left_box) == right_box

Of course, be sure to sanitize your input. You don't want to call destroy!
or something on model_instance.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top