i’m working on a restful interface to existing models in an app.
like to preserve the existing dispatch mechanism and support a parrallel
that looks like
to do this i’d like to setup a rest controller which dispatches based on
http request method and path into. for example, a get sent to
returns xml for student(s) with id 42. a post of xml to
updates the record via a xml doc. of course i’ll never use these and
because i want to preserve the default rails dispatching mechanism and
all rest code into a single controller, thereby enabling the site to be
enables for various formats with the addition of a single controller and
other code modification. the tricky bit is
- how to configure rails such that the path_info (/student/42) is
- how to reuse as much of the existing route/dispaching code as
handle parsing this path_info
any hints appreciated.