Hi guys,

I am working on a problem, that I would like to see if anyone might be
able to help me with.

I have a simple rails application that uses a controller to find a
record in a database. I grab the path that the client is trying to
access, and then I look in a database to see if I have a record that
matches this path and return an appropriate response.

The table looks like this (simplified example):

| path    | response  |
------------------------------
| /users | { users }    |

This is all well and nice, and works the way it should, to expose an
extremely simple REST service. What I would like to do now is to be
able to insert a regular expression, that I will then use to match
against the path. That way having a record value like /\/users\/(\d*)/
to match a client request path like /users/1234.

| path    | response  |
------------------------------
| /\/users\/(\d*)/ | { users }    |

I first looked at 
http://www.postgresql.org/docs/8.3/static/functions-matching.html
(section 9.7.2), but that is the reverse problem, where the input is a
regular expression.

Does my problem make sense, and is it even possible?

Thanks,
JP

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to