Plain english to conditions in ror?

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.

  1. 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.


I would recommend that you create a DSL for your users. You can setup a
mapping that abstracts away your domain specific names and allows for
various types of rule creation. You need to guard/filter against code
injection if you are eval-ing the rules directly.

Hope that helps.

On Wed, May 7, 2008 at 12:59 AM, Varun G. <
[email protected]> wrote:

dynamically.Cos in ROR i can say designation == 'PM’then fine but how i

James M.

Take a look at TreeTop. I’m not sure how complicated you want to get,
but it might be what you are looking for.


On May 6, 9:59 pm, Varun G. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs