Plain english to condition??

Discussion in 'Ruby' started by Varun Goel, May 7, 2008.

  1. Varun Goel

    Varun Goel Guest

    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
    --
    Posted via http://www.ruby-forum.com/.
     
    Varun Goel, May 7, 2008
    #1
    1. Advertising

  2. [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

    On 5/7/08, Varun Goel <> wrote:
    >
    > 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
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >
     
    Daniel Finnie, May 7, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UmFlZCBTYXdhbGhh?=

    English/English DLL

    =?Utf-8?B?UmFlZCBTYXdhbGhh?=, Oct 15, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,707
    =?Utf-8?B?UmFlZCBTYXdhbGhh?=
    Oct 16, 2005
  2. IchBin
    Replies:
    1
    Views:
    808
  3. Me

    'restrict' in plain English?

    Me, Mar 6, 2006, in forum: C Programming
    Replies:
    12
    Views:
    486
    Chris Torek
    Mar 7, 2006
  4. =?Utf-8?B?Q2hhcmxlc0E=?=

    plain english article on how asp.net works with http?

    =?Utf-8?B?Q2hhcmxlc0E=?=, Mar 16, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    400
    =?Utf-8?B?Q2hhcmxlc0E=?=
    Mar 17, 2007
  5. luke
    Replies:
    4
    Views:
    125
    Gene Tani
    Jul 7, 2005
Loading...

Share This Page