[uf-rest] RESTified Rails Controller (take 2)
Peter E Williams
pezra at barelyenough.org
Fri Feb 3 10:07:47 PST 2006
Dan,
That looks nice. I really like the use of the handler arguments to
allow common behaviors to be handled declaratively.
The last version I RestController I saw inherited directly from
ActionController::Base which meant that you could not really just create
a new controller and have it inherit from RestController because you
lost the behaviors on ApplicationContoller (and ApplicationHelper in the
view). You could solve this problem by making ApplicationController
inherit from RestController but it made the restful controllers a bit
less obvious to new comers.
Do you think it would be possible to implement RestController as an
extension to ActionController::Base for the etag stuff (as that is
really applicable any request) and as a mixin for the http-method based
routing and actions? That way when you looked a restful controller you
would notice right way that it was different because there would be a
"include RestActions", or whatever, at the top of the controller.
Have you had any epiphanies about how to handle multiple
representations/views of the same resource?
How are you handling routing? Have you just modified the routes in the
restifarian plugin to match your action names or have you come up with
something different?
Peter
More information about the microformats-rest
mailing list