# Rule Engine?

**URL:** <https://www.ruby-forum.com/t/rule-engine/197176>\
**Category:** Rails\
**Created:** [May 6, 2008, 2:17pm UTC](https://www.ruby-forum.com/t/rule-engine/197176 "2008-05-06T14:17:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![varunkumargoel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ed8c4c/32.png) [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Post date:** [May 6, 2008, 2:17pm UTC](https://www.ruby-forum.com/t/rule-engine/197176/1 "2008-05-06T14:17:43Z")

</div>

Hi,  
I wanna make one dynamic rule engine for that suppose i create one  
rule designation equals Project Leader.

Now my question is that now how i will validate this rule and how i will  
check condition for this in controller.

I can check something like designation.eql?(“Project Leader”) but that  
rule will be in plain English as i said above.

So,please tell me how can i do this.I hope all of you got my  
problem…

Thanks  
Varun

---

<div class="post-metadata">

**Author:** ![varunkumargoel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ed8c4c/32.png) [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Post date:** [May 6, 2008, 2:47pm UTC](https://www.ruby-forum.com/t/rule-engine/197176/2 "2008-05-06T14:47:50Z")

</div>

On 6 May 2008, at 13:17, Varun G. wrote:

> rule will be in plain English as i said above.
> 
> So,please tell me how can i do this.I hope all of you got my  
> problem…

If you want your users to be able to type in conditions in natural  
language that is going to be very tough, natural language parsing is  
not an easy topic. I doubt you need anything quite as flexible as that  
though.  
You could probably implement a fairly simple query language that would  
understand that description:‘Project Leader’ means that the  
description attribute should have that value.

Fred
